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


C#读取web.config文件信息

web.config

<?xml version="1.0"?>
<!--
  有关如何配置 ASP.NET 应用程序的详细信息,请访问
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <appSettings>
    <add key="name" value="name1"/>
  </appSettings>
</configuration>

C#读取

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

C#设置

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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM