資源簡介
本例子為簡單的實現socket服務端和客戶端之間的通訊,簡單明了,適合新手學習。
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?System.Threading;
using?SocketCommon;
using?System.Net.Sockets;
namespace?ClientDemo
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????????Control.CheckForIllegalCrossThreadCalls?=?false;
????????}
????????SocketHelper.TcpClients?client;
????????string?ip?=?string.Empty;
????????string?port?=?string.Empty;
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????//客戶端如何處理異常等信息參照服務端
????????????SocketHelper.pushSockets?=?new?SocketHelper.PushSockets(Rec);//注冊推送器
????????????client?=?new?SocketHelper.Tc
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-08-12?16:54??ClientDemo\
?????文件????????4573??2017-08-12?16:54??ClientDemo\ClientDemo.cs
?????文件????????3684??2017-08-12?16:52??ClientDemo\ClientDemo.csproj
?????文件????????5817??2014-10-18?16:10??ClientDemo\ClientDemo.resx
?????文件???????10428??2014-10-18?16:10??ClientDemo\Form1.Designer.cs
?????文件?????????471??2014-09-11?22:42??ClientDemo\Program.cs
?????目錄???????????0??2017-08-12?15:48??ClientDemo\Properties\
?????文件????????1370??2014-09-11?22:42??ClientDemo\Properties\AssemblyInfo.cs
?????文件????????2872??2014-09-11?22:42??ClientDemo\Properties\Resources.Designer.cs
?????文件????????5612??2014-09-11?22:42??ClientDemo\Properties\Resources.resx
?????文件????????1097??2014-09-11?22:42??ClientDemo\Properties\Settings.Designer.cs
?????文件?????????249??2014-09-11?22:42??ClientDemo\Properties\Settings.settings
?????目錄???????????0??2017-08-12?15:48??ClientDemo\bin\
?????目錄???????????0??2017-08-12?16:58??ClientDemo\bin\Debug\
?????文件???????13824??2017-08-12?16:58??ClientDemo\bin\Debug\ClientDemo.exe
?????文件???????26112??2017-08-12?16:58??ClientDemo\bin\Debug\ClientDemo.pdb
?????文件???????11608??2015-10-13?20:46??ClientDemo\bin\Debug\ClientDemo.vshost.exe
?????文件?????????490??2010-03-17?22:39??ClientDemo\bin\Debug\ClientDemo.vshost.exe.manifest
?????文件???????14848??2017-08-12?16:58??ClientDemo\bin\Debug\SocketCommon.dll
?????文件???????34304??2017-08-12?16:58??ClientDemo\bin\Debug\SocketCommon.pdb
?????目錄???????????0??2017-08-12?18:15??ClientDemo\bin\Release\
?????目錄???????????0??2017-08-12?15:48??ClientDemo\obj\
?????目錄???????????0??2017-08-12?15:48??ClientDemo\obj\x86\
?????目錄???????????0??2017-08-12?16:58??ClientDemo\obj\x86\Debug\
?????文件?????????180??2017-08-12?16:58??ClientDemo\obj\x86\Debug\ClientDemo.Form1.resources
?????文件?????????180??2017-08-12?16:58??ClientDemo\obj\x86\Debug\ClientDemo.Properties.Resources.resources
?????文件????????9308??2017-08-12?16:58??ClientDemo\obj\x86\Debug\ClientDemo.csproj.FileListAbsolute.txt
?????文件?????????852??2017-08-12?16:58??ClientDemo\obj\x86\Debug\ClientDemo.csproj.GenerateResource.Cache
?????文件????????5035??2017-08-12?16:58??ClientDemo\obj\x86\Debug\ClientDemo.csprojResolveAssemblyReference.cache
?????文件???????13824??2017-08-12?16:58??ClientDemo\obj\x86\Debug\ClientDemo.exe
?????文件???????26112??2017-08-12?16:58??ClientDemo\obj\x86\Debug\ClientDemo.pdb
............此處省略65個文件信息
- 上一篇:打造自己的簡易瀏覽器
- 下一篇:C#中實現MVC模式微信支付
評論
共有 條評論