diff --git a/UdpServerCMD/.vs/UdpServerCMD/FileContentIndex/28fd8711-fb25-4999-b998-9b97201be4bd.vsidx b/UdpServerCMD/.vs/UdpServerCMD/FileContentIndex/28fd8711-fb25-4999-b998-9b97201be4bd.vsidx new file mode 100644 index 0000000..2ab0c5e Binary files /dev/null and b/UdpServerCMD/.vs/UdpServerCMD/FileContentIndex/28fd8711-fb25-4999-b998-9b97201be4bd.vsidx differ diff --git a/UdpServerCMD/.vs/UdpServerCMD/FileContentIndex/81321a22-164c-43e2-b51b-bf6d2d9aa82a.vsidx b/UdpServerCMD/.vs/UdpServerCMD/FileContentIndex/81321a22-164c-43e2-b51b-bf6d2d9aa82a.vsidx deleted file mode 100644 index 0760463..0000000 Binary files a/UdpServerCMD/.vs/UdpServerCMD/FileContentIndex/81321a22-164c-43e2-b51b-bf6d2d9aa82a.vsidx and /dev/null differ diff --git a/UdpServerCMD/.vs/UdpServerCMD/FileContentIndex/28ab3d29-2961-435e-a3a4-3c77144225b0.vsidx b/UdpServerCMD/.vs/UdpServerCMD/FileContentIndex/d4746e0e-3486-4f7c-8e1c-6b65abce6246.vsidx similarity index 99% rename from UdpServerCMD/.vs/UdpServerCMD/FileContentIndex/28ab3d29-2961-435e-a3a4-3c77144225b0.vsidx rename to UdpServerCMD/.vs/UdpServerCMD/FileContentIndex/d4746e0e-3486-4f7c-8e1c-6b65abce6246.vsidx index 4804091..5ab3419 100644 Binary files a/UdpServerCMD/.vs/UdpServerCMD/FileContentIndex/28ab3d29-2961-435e-a3a4-3c77144225b0.vsidx and b/UdpServerCMD/.vs/UdpServerCMD/FileContentIndex/d4746e0e-3486-4f7c-8e1c-6b65abce6246.vsidx differ diff --git a/UdpServerCMD/.vs/UdpServerCMD/v17/.suo b/UdpServerCMD/.vs/UdpServerCMD/v17/.suo index 72f75e3..7db9cb1 100644 Binary files a/UdpServerCMD/.vs/UdpServerCMD/v17/.suo and b/UdpServerCMD/.vs/UdpServerCMD/v17/.suo differ diff --git a/UdpServerCMD/Program.cs b/UdpServerCMD/Program.cs index 3c9b956..f42bcf9 100644 --- a/UdpServerCMD/Program.cs +++ b/UdpServerCMD/Program.cs @@ -31,7 +31,7 @@ namespace UdpServerCMD public static Socket udpServer;//udp服务器 public static bool memberReply;//是否回复消息 - public static TypeFunctionCode LastType = TypeFunctionCode.默认; + //public static TypeFunctionCode LastType = TypeFunctionCode.默认; public static int COMPort = 7000;//端口号 public static string IP1 = "172.16.1.49";//连接IP @@ -133,9 +133,10 @@ namespace UdpServerCMD try { //var IP = "111.229.30.246"; - var IP = "172.17.0.9"; - //var IP = "172.16.1.49"; - var Port = 12301; + + //var IP = "172.17.0.9"; + string IP = "172.16.1.49"; + int Port = 12301; //建立udp服务器,参数2:udp协议以数据报的方式传输,参数3:UDP协议 udpServer = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); @@ -452,7 +453,7 @@ namespace UdpServerCMD chars.Add(data[i].ToString()); } //byte[] _returnBytes = new byte[chars.Count]; - byte[] returnBytes = new byte[chars.Count/2]; + byte[] returnBytes = new byte[chars.Count / 2]; //逐个字符变为16进制字节数据 for (int i = 0; i < chars.Count; i++) { @@ -460,7 +461,7 @@ namespace UdpServerCMD { if (i % 2 == 0) { - returnBytes[i/2] = (byte)(Convert.ToByte(chars[i].ToString() + chars[i + 1].ToString(), 16)); + returnBytes[i / 2] = (byte)(Convert.ToByte(chars[i].ToString() + chars[i + 1].ToString(), 16)); } } catch (Exception e) @@ -1539,6 +1540,7 @@ namespace UdpServerCMD clockAnalysis(message, ipEnd); break; default: + Console.WriteLine("无此功能码: " + str); break; } } @@ -1601,6 +1603,9 @@ namespace UdpServerCMD Console.WriteLine("表型:" + s); s.Clear().Append("84"); break; + default: + Console.WriteLine($"无此表型: {phenotype}"); + break; } return s.ToString().Trim(); } @@ -1646,6 +1651,7 @@ namespace UdpServerCMD Console.WriteLine("报警码:" + alarmCode); break; default: + Console.WriteLine($"无此报警码: {alarmCode}"); break; } } diff --git a/UdpServerCMD/bin/Debug/App_Data/Logs_20230221.txt b/UdpServerCMD/bin/Debug/App_Data/Logs_20230221.txt new file mode 100644 index 0000000..e3718f2 --- /dev/null +++ b/UdpServerCMD/bin/Debug/App_Data/Logs_20230221.txt @@ -0,0 +1,4 @@ + ------------------------------------------------ +2023-02-21 17:55:27,859 [1] INFO loginfo - :40 3A 00 48 15 13 34 50 23 03 81 E0 3E E7 1E 83 3E D0 1F 31 8A 6B AE DD 42 65 D7 8C 96 B1 84 51 36 32 95 E8 D6 D8 CA 96 51 D4 3F 91 03 20 97 26 50 E7 4A C5 7F CF A2 12 74 7A F8 BA 15 2A AD B6 C0 6A 37 49 B2 E1 35 24 01 EB 85 9E 0D 0A + ------------------------------------------------ +2023-02-21 17:55:41,547 [1] INFO loginfo - :40 3A 00 48 15 13 34 50 23 03 81 E0 3E E7 1E 83 3E D0 1F 31 8A 6B AE DD 42 65 D7 8C 96 B1 84 51 36 32 95 E8 D6 D8 CA 96 51 D4 3F 91 03 20 97 26 50 E7 4A C5 7F CF A2 12 74 7A F8 BA 15 2A AD B6 C0 6A 37 49 B2 E1 35 24 01 EB 85 9E 0D 0A diff --git a/UdpServerCMD/bin/Debug/UdpServerCMD.exe b/UdpServerCMD/bin/Debug/UdpServerCMD.exe index 8effbef..e62a4aa 100644 Binary files a/UdpServerCMD/bin/Debug/UdpServerCMD.exe and b/UdpServerCMD/bin/Debug/UdpServerCMD.exe differ diff --git a/UdpServerCMD/bin/Debug/UdpServerCMD.pdb b/UdpServerCMD/bin/Debug/UdpServerCMD.pdb index 2f97823..f6a30c3 100644 Binary files a/UdpServerCMD/bin/Debug/UdpServerCMD.pdb and b/UdpServerCMD/bin/Debug/UdpServerCMD.pdb differ diff --git a/UdpServerCMD/bin/Release/UdpServerCMD.exe b/UdpServerCMD/bin/Release/UdpServerCMD.exe index 18ac46d..ef2dfbe 100644 Binary files a/UdpServerCMD/bin/Release/UdpServerCMD.exe and b/UdpServerCMD/bin/Release/UdpServerCMD.exe differ diff --git a/UdpServerCMD/bin/Release/UdpServerCMD.pdb b/UdpServerCMD/bin/Release/UdpServerCMD.pdb index b911942..e917e4c 100644 Binary files a/UdpServerCMD/bin/Release/UdpServerCMD.pdb and b/UdpServerCMD/bin/Release/UdpServerCMD.pdb differ diff --git a/UdpServerCMD/obj/Debug/UdpServerCMD.csproj.CoreCompileInputs.cache b/UdpServerCMD/obj/Debug/UdpServerCMD.csproj.CoreCompileInputs.cache index dafbdf0..e861f97 100644 --- a/UdpServerCMD/obj/Debug/UdpServerCMD.csproj.CoreCompileInputs.cache +++ b/UdpServerCMD/obj/Debug/UdpServerCMD.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -f303633fc61bd04e4c3f7a497d9f456d27506847 +5a19b734824e0e2fc92080fabad66652b743c3cb diff --git a/UdpServerCMD/obj/Debug/UdpServerCMD.csproj.FileListAbsolute.txt b/UdpServerCMD/obj/Debug/UdpServerCMD.csproj.FileListAbsolute.txt index 998dd4d..b02cb07 100644 --- a/UdpServerCMD/obj/Debug/UdpServerCMD.csproj.FileListAbsolute.txt +++ b/UdpServerCMD/obj/Debug/UdpServerCMD.csproj.FileListAbsolute.txt @@ -9,3 +9,14 @@ D:\GaoGuoZheng_U3D\C#\UdpServerCMD\obj\Debug\UdpServerCMD.pdb D:\GaoGuoZheng_U3D\C#\UdpServerCMD\bin\Debug\log4net.dll D:\GaoGuoZheng_U3D\C#\UdpServerCMD\bin\Debug\log4net.xml D:\GaoGuoZheng_U3D\C#\UdpServerCMD\obj\Debug\UdpServerCMD.csproj.CopyComplete +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\bin\Debug\UdpServerCMD.exe.config +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\bin\Debug\UdpServerCMD.exe +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\bin\Debug\UdpServerCMD.pdb +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\bin\Debug\log4net.dll +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\bin\Debug\log4net.xml +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\obj\Debug\UdpServerCMD.csproj.AssemblyReference.cache +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\obj\Debug\UdpServerCMD.csproj.SuggestedBindingRedirects.cache +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\obj\Debug\UdpServerCMD.csproj.CoreCompileInputs.cache +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\obj\Debug\UdpServerCMD.csproj.CopyComplete +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\obj\Debug\UdpServerCMD.exe +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\obj\Debug\UdpServerCMD.pdb diff --git a/UdpServerCMD/obj/Debug/UdpServerCMD.exe b/UdpServerCMD/obj/Debug/UdpServerCMD.exe index 8effbef..e62a4aa 100644 Binary files a/UdpServerCMD/obj/Debug/UdpServerCMD.exe and b/UdpServerCMD/obj/Debug/UdpServerCMD.exe differ diff --git a/UdpServerCMD/obj/Debug/UdpServerCMD.pdb b/UdpServerCMD/obj/Debug/UdpServerCMD.pdb index 2f97823..f6a30c3 100644 Binary files a/UdpServerCMD/obj/Debug/UdpServerCMD.pdb and b/UdpServerCMD/obj/Debug/UdpServerCMD.pdb differ diff --git a/UdpServerCMD/obj/Release/UdpServerCMD.csproj.AssemblyReference.cache b/UdpServerCMD/obj/Release/UdpServerCMD.csproj.AssemblyReference.cache index 20ac9bf..243252b 100644 Binary files a/UdpServerCMD/obj/Release/UdpServerCMD.csproj.AssemblyReference.cache and b/UdpServerCMD/obj/Release/UdpServerCMD.csproj.AssemblyReference.cache differ diff --git a/UdpServerCMD/obj/Release/UdpServerCMD.csproj.CoreCompileInputs.cache b/UdpServerCMD/obj/Release/UdpServerCMD.csproj.CoreCompileInputs.cache index 58e9fdd..61c1a38 100644 --- a/UdpServerCMD/obj/Release/UdpServerCMD.csproj.CoreCompileInputs.cache +++ b/UdpServerCMD/obj/Release/UdpServerCMD.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -fe6e0c5922c5cf5954e01895b33fd933877075b4 +d029687411ab201d571c29f5274ab02dc72104b0 diff --git a/UdpServerCMD/obj/Release/UdpServerCMD.csproj.FileListAbsolute.txt b/UdpServerCMD/obj/Release/UdpServerCMD.csproj.FileListAbsolute.txt index f7b214c..7803bcd 100644 --- a/UdpServerCMD/obj/Release/UdpServerCMD.csproj.FileListAbsolute.txt +++ b/UdpServerCMD/obj/Release/UdpServerCMD.csproj.FileListAbsolute.txt @@ -9,3 +9,14 @@ D:\GaoGuoZheng_U3D\C#\UdpServerCMD\obj\Release\UdpServerCMD.pdb D:\GaoGuoZheng_U3D\C#\UdpServerCMD\bin\Release\log4net.dll D:\GaoGuoZheng_U3D\C#\UdpServerCMD\bin\Release\log4net.xml D:\GaoGuoZheng_U3D\C#\UdpServerCMD\obj\Release\UdpServerCMD.csproj.CopyComplete +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\bin\Release\UdpServerCMD.exe.config +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\bin\Release\UdpServerCMD.exe +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\bin\Release\UdpServerCMD.pdb +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\bin\Release\log4net.dll +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\bin\Release\log4net.xml +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\obj\Release\UdpServerCMD.csproj.AssemblyReference.cache +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\obj\Release\UdpServerCMD.csproj.SuggestedBindingRedirects.cache +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\obj\Release\UdpServerCMD.csproj.CoreCompileInputs.cache +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\obj\Release\UdpServerCMD.csproj.CopyComplete +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\obj\Release\UdpServerCMD.exe +D:\GaoGuoZheng_U3D\C#\ZHshuibiao\UdpServerCMD\obj\Release\UdpServerCMD.pdb diff --git a/UdpServerCMD/obj/Release/UdpServerCMD.exe b/UdpServerCMD/obj/Release/UdpServerCMD.exe index 18ac46d..ef2dfbe 100644 Binary files a/UdpServerCMD/obj/Release/UdpServerCMD.exe and b/UdpServerCMD/obj/Release/UdpServerCMD.exe differ diff --git a/UdpServerCMD/obj/Release/UdpServerCMD.pdb b/UdpServerCMD/obj/Release/UdpServerCMD.pdb index b911942..e917e4c 100644 Binary files a/UdpServerCMD/obj/Release/UdpServerCMD.pdb and b/UdpServerCMD/obj/Release/UdpServerCMD.pdb differ