.net配置文件读取


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"/>

原文地址:https://www.cnblogs.com/King-JJ/p/6022697.html