深蓝IT
深蓝.NET(C#)技术交流群:257018781
主页
所有分类
留言板
标签
搜索
首页
>>
VS.NET
如何读取web.config中自定义的信息
来源:
时间:
2012-08-13 21:29:12
如何读取web.config中自定义的信息:
它本身就是一个xml文件,可以按照读取xml文件得方法来读取其中得数据:
代码如下:
XmlDocument xml = new XmlDocument();
var configPath = new System.Web.UI.Page().Server.MapPath("~\\web.config");
xml.Load(configPath);
var node = xml.SelectSingleNode("configuration");