wsd_djy/WebSiteCode/Cmdjy/CmdjyHisFront/WebSettings.cs

30 lines
766 B
C#
Raw Normal View History

using System.Configuration;
namespace CmdjyHisFront
{
/// <summary>
/// 网站配置
/// </summary>
public static class WebSettings
{
/// <summary>
/// 获取配置的值
/// </summary>
public static string GetValue(string key) {
var val = ConfigurationManager.AppSettings[key];
return val;
}
/// <summary>
/// 自动升级数据库
/// </summary>
public static bool AutoMigrations {
get {
var val = GetValue("AutoMigrations");
if(bool.TryParse(val,out bool v)) {
return v;
}
2019-03-25 16:32:58 +08:00
return false;
}
}
}
}