How to read values from custom section in web.config

后端 未结 1 1246
野趣味
野趣味 2020-12-04 23:34

I have added a custom section called secureAppSettings to my web.config file:


  &l         


        
相关标签:
1条回答
  • 2020-12-05 00:00

    You could access them as key/value pairs:

    NameValueCollection section = (NameValueCollection)ConfigurationManager.GetSection("secureAppSettings");
    string userName = section["userName"];
    string userPassword = section["userPassword"];
    
    0 讨论(0)
提交回复
热议问题