1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using Newtonsoft.Json;
using System.IO;
namespace FLY.Integrated.Server
{
public class SysParam
{
/// <summary>
/// OBJ服务端口
/// </summary>
public int OBJ_Port { get; set; } = 20003;
/// <summary>
/// 数据库保持时间 默认6个月
/// </summary>
public int DBKeepMonth { get; set; } = 6;
public SysParam()
{
Load();
}
public void Save()
{
string json = JsonConvert.SerializeObject(this, Formatting.Indented);
File.WriteAllText("system.json", json);
}
public void Load()
{
if (File.Exists("system.json"))
{
try
{
string json = File.ReadAllText("system.json");
JsonConvert.PopulateObject(json, this);
}
catch
{
}
}
}
}
}