using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Configuration; namespace ShadowEditor.Server.Helpers { /// /// 配置管理器 /// public sealed class ConfigHelper { /// /// Mongo数据库连接 /// public static string MongoConnection { get { return ConfigurationManager.AppSettings["mongo_connection"]; } } /// /// Mongo数据库名称 /// public static string MongoDBName { get { return ConfigurationManager.AppSettings["mongo_dbName"]; } } /// /// 是否开启权限管理,true: 开启, false: 关闭 /// public static bool EnableAuthority { get { return ConfigurationManager.AppSettings["EnableAuthority"] == "true"; } } /// /// 登录时长设置,分钟,只允许整数。 /// public static int Expires { get { return Convert.ToInt32(ConfigurationManager.AppSettings["Expires"].ToString()); } } /// /// 是否开启远程编辑,true: 开启,false: 关闭 /// public static bool EnableRemoteEdit { get { return ConfigurationManager.AppSettings["EnableRemoteEdit"] == "true"; } } /// /// WebSocket服务器端口(远程编辑用) /// public static int WebSocketServerPort { get { return Convert.ToInt32(ConfigurationManager.AppSettings["WebSocketServerPort"]); } } } }