How to add Application name to ?

后端 未结 3 424
遇见更好的自我
遇见更好的自我 2021-01-25 06:21

This is my app.config file looks like:



    
      

        
3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-25 07:20

    There is a better way by using the following steps:

    1) Add a reference to System.Configuration to your application.

    2) Add the following block to your app.config file, within the configuration section:

      
        
      
    

    3) Retrieve the value and use it where needed with the following code (example from your answer shown):

    param6.Value = System.Configuration.ConfigurationManager.AppSettings("ApplicationName")
    

提交回复
热议问题