using Ems.CollectService.Common; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Ems.CollectService.Entity.config { public sealed class AppConfig { private static readonly Lazy lazy = new Lazy(() => new AppConfig()); private static StringChange stringChange = StringChange.Instance; public static AppConfig Instance { get { return lazy.Value; } } private AppConfig() { } private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/config/App.InI"); /// /// 监听端口 /// public int listenerPort { get { return stringChange.ParseToInt(iNIFile.IniReadValue("SystemConfig", "listenerPort")); } set { iNIFile.IniWriteValue("SystemConfig", "listenerPort", value.ToString()); } } /// /// Mysql地址 /// public string mysqlStr { get { return iNIFile.IniReadValue("SystemConfig", "mysqlConnStr"); } set { iNIFile.IniWriteValue("SystemConfig", "mysqlConnStr", value.ToString()); } } } }