C# TCP发送命令并接收解析返回结果

上传者: liuenwen | 上传时间: 2021-04-25 20:45:58 | 文件大小: 87KB | 文件类型: RAR
我们在和硬件做对接时一般是给设备发送命令,然后设备返回结果。如果在发送时我就想知道设备有没有成功执行那该怎么办呢? 我网上查过很多资料,没找到满意的结果,最终自己无意尝试实现了这个功能。其实也很简单,公布出来给需要的小伙伴们做参考。

文件下载

资源详情

[{"title":"( 56 个子文件 87KB ) C# TCP发送命令并接收解析返回结果","children":[{"title":"TCP_Demo","children":[{"title":".vs","children":[{"title":"TCP_Demo","children":[{"title":"v16","children":[{"title":".suo <span style='color:#111;'> 41.00KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"TCP_Demo.sln <span style='color:#111;'> 1.56KB </span>","children":null,"spread":false},{"title":"Client","children":[{"title":"Client.csproj.vspscc <span style='color:#111;'> 257B </span>","children":null,"spread":false},{"title":"ClientForm.resx <span style='color:#111;'> 5.68KB </span>","children":null,"spread":false},{"title":"ClientForm.cs <span style='color:#111;'> 4.11KB </span>","children":null,"spread":false},{"title":"Program.cs <span style='color:#111;'> 523B </span>","children":null,"spread":false},{"title":"Properties","children":[{"title":"Settings.settings <span style='color:#111;'> 249B </span>","children":null,"spread":false},{"title":"Resources.Designer.cs <span style='color:#111;'> 2.76KB </span>","children":null,"spread":false},{"title":"AssemblyInfo.cs <span style='color:#111;'> 1.27KB </span>","children":null,"spread":false},{"title":"Settings.Designer.cs <span style='color:#111;'> 1.07KB </span>","children":null,"spread":false},{"title":"Resources.resx <span style='color:#111;'> 5.48KB </span>","children":null,"spread":false}],"spread":true},{"title":"App.config <span style='color:#111;'> 189B </span>","children":null,"spread":false},{"title":"Client.csproj <span style='color:#111;'> 3.72KB </span>","children":null,"spread":false},{"title":"obj","children":[{"title":"Debug","children":[{"title":"Client.ClientForm.resources <span style='color:#111;'> 180B </span>","children":null,"spread":false},{"title":"Client.exe <span style='color:#111;'> 12.50KB </span>","children":null,"spread":false},{"title":"Client.csproj.CoreCompileInputs.cache <span style='color:#111;'> 42B </span>","children":null,"spread":false},{"title":"TempPE","children":null,"spread":false},{"title":"Client.csprojAssemblyReference.cache <span style='color:#111;'> 11.35KB </span>","children":null,"spread":false},{"title":"DesignTimeResolveAssemblyReferencesInput.cache <span style='color:#111;'> 6.97KB </span>","children":null,"spread":false},{"title":"Client.Properties.Resources.resources <span style='color:#111;'> 180B </span>","children":null,"spread":false},{"title":"Client.csproj.FileListAbsolute.txt <span style='color:#111;'> 1.04KB </span>","children":null,"spread":false},{"title":".NETFramework,Version=v4.7.2.AssemblyAttributes.cs <span style='color:#111;'> 214B </span>","children":null,"spread":false},{"title":"DesignTimeResolveAssemblyReferences.cache <span style='color:#111;'> 1.40KB </span>","children":null,"spread":false},{"title":"Client.pdb <span style='color:#111;'> 41.50KB </span>","children":null,"spread":false},{"title":"Client.csproj.GenerateResource.cache <span style='color:#111;'> 1017B </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"bin","children":[{"title":"Debug","children":[{"title":"Client.exe <span style='color:#111;'> 12.50KB </span>","children":null,"spread":false},{"title":"Client.exe.config <span style='color:#111;'> 189B </span>","children":null,"spread":false},{"title":"Client.pdb <span style='color:#111;'> 41.50KB </span>","children":null,"spread":false}],"spread":true},{"title":"Release","children":null,"spread":false}],"spread":true},{"title":"Common.cs <span style='color:#111;'> 3.19KB </span>","children":null,"spread":false},{"title":"ClientForm.Designer.cs <span style='color:#111;'> 3.59KB </span>","children":null,"spread":false}],"spread":false},{"title":"Server","children":[{"title":"ServerForm.resx <span style='color:#111;'> 5.68KB </span>","children":null,"spread":false},{"title":"Program.cs <span style='color:#111;'> 523B </span>","children":null,"spread":false},{"title":"Server.csproj <span style='color:#111;'> 3.72KB </span>","children":null,"spread":false},{"title":"Properties","children":[{"title":"Settings.settings <span style='color:#111;'> 249B </span>","children":null,"spread":false},{"title":"Resources.Designer.cs <span style='color:#111;'> 2.76KB </span>","children":null,"spread":false},{"title":"AssemblyInfo.cs <span style='color:#111;'> 1.27KB </span>","children":null,"spread":false},{"title":"Settings.Designer.cs <span style='color:#111;'> 1.07KB </span>","children":null,"spread":false},{"title":"Resources.resx <span style='color:#111;'> 5.48KB </span>","children":null,"spread":false}],"spread":true},{"title":"ServerForm.Designer.cs <span style='color:#111;'> 4.06KB </span>","children":null,"spread":false},{"title":"App.config <span style='color:#111;'> 189B </span>","children":null,"spread":false},{"title":"obj","children":[{"title":"Debug","children":[{"title":"Server.Properties.Resources.resources <span style='color:#111;'> 180B </span>","children":null,"spread":false},{"title":"Server.pdb <span style='color:#111;'> 39.50KB </span>","children":null,"spread":false},{"title":"Server.csprojAssemblyReference.cache <span style='color:#111;'> 2.32KB </span>","children":null,"spread":false},{"title":"Server.csproj.FileListAbsolute.txt <span style='color:#111;'> 1.73KB </span>","children":null,"spread":false},{"title":"TempPE","children":null,"spread":false},{"title":"Server.ServerForm.resources <span style='color:#111;'> 180B </span>","children":null,"spread":false},{"title":"DesignTimeResolveAssemblyReferencesInput.cache <span style='color:#111;'> 6.97KB </span>","children":null,"spread":false},{"title":"Server.csproj.CoreCompileInputs.cache <span style='color:#111;'> 42B </span>","children":null,"spread":false},{"title":".NETFramework,Version=v4.7.2.AssemblyAttributes.cs <span style='color:#111;'> 214B </span>","children":null,"spread":false},{"title":"DesignTimeResolveAssemblyReferences.cache <span style='color:#111;'> 424B </span>","children":null,"spread":false},{"title":"Server.csproj.GenerateResource.cache <span style='color:#111;'> 1017B </span>","children":null,"spread":false},{"title":"Server.exe <span style='color:#111;'> 13.50KB </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"Server.csproj.vspscc <span style='color:#111;'> 257B </span>","children":null,"spread":false},{"title":"bin","children":[{"title":"Debug","children":[{"title":"Server.pdb <span style='color:#111;'> 39.50KB </span>","children":null,"spread":false},{"title":"Server.exe.config <span style='color:#111;'> 189B </span>","children":null,"spread":false},{"title":"Server.exe <span style='color:#111;'> 13.50KB </span>","children":null,"spread":false}],"spread":true},{"title":"Release","children":null,"spread":false}],"spread":true},{"title":"ServerForm.cs <span style='color:#111;'> 2.91KB </span>","children":null,"spread":false},{"title":"Common.cs <span style='color:#111;'> 3.84KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明