读取webconfit appsetings的值

来源:互联网 发布:ipad air2蜂窝数据 编辑:程序博客网 时间:2024/06/05 15:31

1.在项目的引用添加:System.Configuration

2.添加命名空间:using System.Configuration;

3.读取值:  serverRootPath=ConfigurationManager.AppSettings["StandardLibrary"]

 

<appSettings>

       <!--<add key="rootPath" value="d:/fileServer/"/>-->
    <!--<add key="rootPath" value="//10.1.30.19/d$/fileServer/"/>-->
     <add key="StandardLibrary" value="//10.1.455.5/Software"/>
  </appSettings>

原创粉丝点击