public static string LogPath { get { return AppSettingValue(); } } public static string AppSettingValue([CallerMemberName] string key = null) { return ConfigurationManager.AppSettings[key]; }

  使用:

AppSettingConfig.LogPath

配置文件:

    <add key="LogPath" value="d:\\test"/>

 

posted on 2016-11-02 13:52  慕凡尘  阅读(304)  评论(0编辑  收藏  举报