This commit is contained in:
Administrator committed 2026-06-01 13:28:00 +08:00
commit 6b16bc838c
10 files changed
+222 -25

No files matched your search

+24 -16
View File
@@ -28,6 +28,9 @@ namespace SunlightAggregationManager.ViewModel
public static string SQLPASWORD = "";
public static string MachineName = "SERVER";
public static string MachineVer = "1.0.0";
public static string MachineIP = "";
public static int MachineIPP1 = 7789;
public static int MachineIPP2 = 7790;
public static string Enterprise = "";
public static string TCP_E = "0";
public static string HTTP_E = "0";
@@ -99,31 +102,26 @@ namespace SunlightAggregationManager.ViewModel
//运行数据库
Service.Rows.Add(0, "RUN", "SQL_DataBase_Link");
dataBase.Config(SQLIP, SQLNAME, SQMOD, SQLUSER, SQLPASWORD);
Service.Rows.Add(1, "RUN", "Sunlight_Server_Link");
AsyncTcpClient.Configuration(SERVERIP, SERVERNAME, SERVERUSER, SERRVERPASWORD);//连接sunlight服务器
Console.WriteLine(GetLocalIP.GetLocalIPv4Address().ToString());
if (TCP_E == "1")//启动tcp(内网直连)
{
int P1, P2;
try
{
P1 = int.Parse(Configini.IniReadvalue("NETWORK", "TCP_PORT1"));
MachineIPP1 = int.Parse(Configini.IniReadvalue("NETWORK", "TCP_PORT1"));
}
catch (Exception) { P1 = 7789; }
catch (Exception) { MachineIPP1 = 7789; }
try
{
P2 = int.Parse(Configini.IniReadvalue("NETWORK", "TCP_PORT2"));
MachineIPP2 = int.Parse(Configini.IniReadvalue("NETWORK", "TCP_PORT2"));
}
catch (Exception) { P2 = 7790; }
catch (Exception) { MachineIPP2 = 7790; }
Service.Rows.Add(2, "RUN", "TCP");
_ = AsyncTcpServer.TcpMain(P1, P2);
Service.Rows.Add(1, "RUN", "TCP");
AsyncTcpServer.Configuration(MachineIPP1, MachineIPP2);
}
else
{
Service.Rows.Add(2, "STOP", "TCP");
Service.Rows.Add(1, "STOP", "TCP");
}
if (HTTP_E == "1")//启动tcp(内网直连)
{
@@ -134,13 +132,23 @@ namespace SunlightAggregationManager.ViewModel
}
catch (Exception) { P1 = 7791; }
Service.Rows.Add(3, "RUN", "HTTP");
_ = AsyncHttpServer.HttpMain(P1);
Service.Rows.Add(2, "RUN", "HTTP");
AsyncHttpServer.Configuration(P1);
}
else
{
Service.Rows.Add(3, "STOP", "HTTP");
Service.Rows.Add(2, "STOP", "HTTP");
}
//获取当前IP
MachineIP = GetLocalIP.GetLocalIPv4Address().ToString();
Console.WriteLine(MachineIP);
//连接sunlight服务器
Service.Rows.Add(3, "RUN", "Sunlight_Server_Link");
AsyncTcpClient.Configuration(SERVERIP, SERVERNAME, SERVERUSER, SERRVERPASWORD);
Service.EndInit();
}