读取配置文件参数和文件路径

1.读取配置文件参数

<appSettings>
    <add key="Log4net" value="1"/>

</appSettings>

string filePath = System.Configuration.ConfigurationManager.AppSettings["log4netPath"].ToString();

System.IO.FileInfo file = new System.IO.FileInfo(HttpContext.Current.Server.MapPath(filePath));

posted @ 2016-03-29 11:10  李寒星  阅读(366)  评论(0编辑  收藏  举报