You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.3 KiB
C#

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<AppConfig> lazy = new Lazy<AppConfig>(() => 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");
/// <summary>
/// 监听端口
/// </summary>
public int listenerPort
{
get { return stringChange.ParseToInt(iNIFile.IniReadValue("SystemConfig", "listenerPort")); }
set { iNIFile.IniWriteValue("SystemConfig", "listenerPort", value.ToString()); }
}
/// <summary>
/// Mysql地址
/// </summary>
public string mysqlStr
{
get { return iNIFile.IniReadValue("SystemConfig", "mysqlConnStr"); }
set { iNIFile.IniWriteValue("SystemConfig", "mysqlConnStr", value.ToString()); }
}
}
}