aspx.cs文件中写以下内容:
AppSettingsReader  AppRead   =   new   AppSettingsReader();
string url   =   Convert.ToString( AppRead.GetValue( "addressUrl",   typeof(string)));  

config内容中另起一个节点:写以下内容

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

</appSettings> 

这样就可以读取Config文件的内容了。

相关文章: