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

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));

原文地址:https://www.cnblogs.com/hanxingli/p/5332193.html