ASP.NET读取和设置Web.config文件

C#读取web.config文件信息

web.config




  
    
  

C#读取

 string name = System.Web.Configuration.WebConfigurationManager.AppSettings["name"];

C#设置

 System.Web.Configuration.WebConfigurationManager.AppSettings.Set("name", "name2");

你可能感兴趣的:(asp.net,.net(C#),基础知识,asp.net,c#)