|
|
@ -5,10 +5,12 @@ using System.Data; |
|
|
using System.Security.Cryptography.Pkcs; |
|
|
using System.Security.Cryptography.Pkcs; |
|
|
using System.Text; |
|
|
using System.Text; |
|
|
using System.Text.Json; |
|
|
using System.Text.Json; |
|
|
|
|
|
using System.Windows; |
|
|
using System.Windows.Markup; |
|
|
using System.Windows.Markup; |
|
|
using System.Xml.Linq; |
|
|
using System.Xml.Linq; |
|
|
using TouchSocket.Core; |
|
|
using TouchSocket.Core; |
|
|
using TouchSocket.Sockets; |
|
|
using TouchSocket.Sockets; |
|
|
|
|
|
using static SunlightAggregationManager.UserClass.AsyncTcpServer; |
|
|
|
|
|
|
|
|
namespace SunlightAggregationManager.UserClass |
|
|
namespace SunlightAggregationManager.UserClass |
|
|
{ |
|
|
{ |
|
|
@ -67,7 +69,7 @@ namespace SunlightAggregationManager.UserClass |
|
|
MainWindowViewModel.Updata_Memory(MainWindowViewModel._userData, "User='" + deserializedPerson?.User + "'", myDict); |
|
|
MainWindowViewModel.Updata_Memory(MainWindowViewModel._userData, "User='" + deserializedPerson?.User + "'", myDict); |
|
|
|
|
|
|
|
|
Console.WriteLine("[Log on]User[" + deserializedPerson?.User + "]Note[" + (deserializedPerson?.Dat ?? "unknown") + "]"); |
|
|
Console.WriteLine("[Log on]User[" + deserializedPerson?.User + "]Note[" + (deserializedPerson?.Dat ?? "unknown") + "]"); |
|
|
Command(deserializedPerson?.Dat ?? "NOT", client.Id); |
|
|
Command(deserializedPerson?.Dat ?? "NOT", client.Id, deserializedPerson!); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{//首次登录记录
|
|
|
{//首次登录记录
|
|
|
@ -94,8 +96,9 @@ namespace SunlightAggregationManager.UserClass |
|
|
login.Add("UserId", dat?.Field<object>("UserID") ?? ""); |
|
|
login.Add("UserId", dat?.Field<object>("UserID") ?? ""); |
|
|
login.Add("UserName", dat?.Field<object>("Name") ?? ""); |
|
|
login.Add("UserName", dat?.Field<object>("Name") ?? ""); |
|
|
|
|
|
|
|
|
var d = JsonSerializer.Serialize(login); |
|
|
deserializedPerson!.Dat = JsonSerializer.Serialize(login); |
|
|
client.SendAsync(d); |
|
|
var jsdat = JsonSerializer.Serialize(deserializedPerson); |
|
|
|
|
|
client.SendAsync(jsdat); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
@ -164,7 +167,7 @@ namespace SunlightAggregationManager.UserClass |
|
|
Console.WriteLine("TCP SERVER:START"); |
|
|
Console.WriteLine("TCP SERVER:START"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static async void Command(string dat,string id)//
|
|
|
public static async void Command(string dat,string id , Person person)//
|
|
|
{ |
|
|
{ |
|
|
string Command="", ret =""; |
|
|
string Command="", ret =""; |
|
|
|
|
|
|
|
|
@ -215,7 +218,9 @@ namespace SunlightAggregationManager.UserClass |
|
|
ret = JsonSerializer.Serialize(data_); |
|
|
ret = JsonSerializer.Serialize(data_); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
await service.SendAsync(id, ret); |
|
|
person.Dat=ret.ToString(); |
|
|
|
|
|
var jsdat = JsonSerializer.Serialize(person); |
|
|
|
|
|
await service.SendAsync(id, jsdat); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static List<Dictionary<string, object?>>? ToList(DataTable table)//datatable转list
|
|
|
public static List<Dictionary<string, object?>>? ToList(DataTable table)//datatable转list
|
|
|
|