diff --git a/SocketExample/TCPWindowV2.xaml.cs b/SocketExample/TCPWindowV2.xaml.cs index e6ff33d..a3695a9 100644 --- a/SocketExample/TCPWindowV2.xaml.cs +++ b/SocketExample/TCPWindowV2.xaml.cs @@ -290,8 +290,8 @@ namespace SocketExample string tempWritestate = ""; for (int n = 0;n < (Convert.ToInt32(dataLength,16)/5);n++) { - tempReadstate += $"A{n+1}:{Convert.ToInt32(readStateString.Substring(12+10*n,4),16).ToString()} "; - tempWritestate += $"A{n + 1}:{Convert.ToInt32(readStateString.Substring(16 + 10 * n, 4), 16).ToString()} "; + tempReadstate += $"A{n+1} : {(Convert.ToInt32(readStateString.Substring(12+10*n,4),16)/100).ToString()} "; + tempWritestate += $"A{n + 1} : {(Convert.ToInt32(readStateString.Substring(16 + 10 * n, 4), 16) / 100).ToString()} "; } ReadPowerState = tempReadstate; WritePowerState = tempWritestate; @@ -440,7 +440,7 @@ namespace SocketExample //连接事件 client.Connected += onConnected; //断连事件 - client.Closed = (client, e) => { Infotext += "已断开!\n"; StateColour = "Red"; LinkState = "未连接"; streamWriter.Close(); return EasyTask.CompletedTask; }; + client.Closed = (client, e) => { Infotext += "已断开!\n"; StateColour = "Red"; LinkState = "未连接"; return EasyTask.CompletedTask; }; //接收事件 client.Received += onRecieved;