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