首页 > 代码库 > C# 读取webConfig配置

C# 读取webConfig配置

获取百度URL 

var url = System.Configuration.ConfigurationManager.AppSettings["BaiduUrl"];

<configuration>
  <appSettings>
    <add key="BaiDuUrl" value="http://baidu.com" />
  </appSettings>
</configuration>

  

 

C# 读取webConfig配置