資源簡介
的多線程多客戶端異步聊天通訊源碼
1、Async文件都是異步的客戶端與服務端。
2、首先要啟動對應的服務端監聽,然后在啟動Cient客戶端進行登錄在聊天室進行聊天。
線程池(多線程) 異步 委托(lamdba) UI跨線程(界面實時響應) 遞歸(樹形實時更新) TCPIP掃描,綜合起來的一個實例,對于初學者有很大的幫助。
代碼片段和文件信息
using?System;
using?System.ComponentModel;
using?System.Windows.Forms;
using?System.Net;
using?System.Net.Sockets;
using?System.Threading;
using?System.IO;
namespace?AsyncTcpClient
{
????public?partial?class?FormClient?:?Form
????{
????????//是否正常退出
????????private?bool?isExit?=?false;
????????private?TcpClient?client;
????????private?BinaryReader?br;
????????private?BinaryWriter?bw;
????????//BackgroundWorker?connectWork?=?new?BackgroundWorker();
????????public?FormClient()
????????{
????????????InitializeComponent();
????????????this.StartPosition?=?FormStartPosition.CenterScreen;
????????????Random?r?=?new?Random((int)DateTime.Now.Ticks);
????????????textBoxUserName.Text?=?“user“?+?r.Next(100?999);
????????????listBoxOnline.HorizontalScrollbar?=?true;
???????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????..A..H.?????38400??2019-01-16?16:32??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\.vs\AsyncTcpClient\v14\.suo
????..A..H.?????68608??2019-01-18?11:09??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\.vs\AsyncTcpClient\v15\.suo
?????文件??????????0??2019-01-17?13:37??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\.vs\AsyncTcpClient\v15\Server\sqlite3\db.lock
?????文件???????4096??2019-01-17?13:37??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\.vs\AsyncTcpClient\v15\Server\sqlite3\storage.ide
?????文件??????32768??2019-01-18?11:08??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\.vs\AsyncTcpClient\v15\Server\sqlite3\storage.ide-shm
?????文件?????552112??2019-01-17?13:39??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\.vs\AsyncTcpClient\v15\Server\sqlite3\storage.ide-wal
?????文件???????3568??2019-01-16?16:31??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\AsyncTcpClient.csproj
?????文件???????1481??2012-02-28?12:01??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\AsyncTcpClient.idc
?????文件??????15360??2019-01-17?13:37??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\bin\Debug\AsyncTcpClient.exe
?????文件??????28160??2019-01-17?13:37??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\bin\Debug\AsyncTcpClient.pdb
?????文件??????21680??2019-01-16?16:31??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\bin\Debug\AsyncTcpClient.vshost.exe
?????文件????????490??2018-04-12?07:35??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\bin\Debug\AsyncTcpClient.vshost.exe.manifest
?????文件??????10264??2012-02-20?08:44??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\FormClient.cs
?????文件???????8440??2009-07-22?01:48??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\FormClient.Designer.cs
?????文件???????5814??2009-07-22?01:48??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\FormClient.resx
?????文件????????322??2006-04-19?16:04??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\obj\AsyncTcpClient.csproj.FileList.txt
?????文件???????1466??2008-04-03?09:55??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\obj\AsyncTcpClient.csproj.FileListAbsolute.txt
?????文件?????????42??2019-01-17?13:37??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\obj\Debug\AsyncTcpClient.csproj.CoreCompileInputs.cache
?????文件??????10354??2019-01-17?13:37??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\obj\Debug\AsyncTcpClient.csproj.FileListAbsolute.txt
?????文件????????852??2011-10-29?09:26??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\obj\Debug\AsyncTcpClient.csproj.GenerateResource.Cache
?????文件???????6849??2019-01-17?13:37??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\obj\Debug\AsyncTcpClient.csprojAssemblyReference.cache
?????文件??????15360??2019-01-17?13:37??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\obj\Debug\AsyncTcpClient.exe
?????文件????????180??2019-01-17?13:37??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\obj\Debug\AsyncTcpClient.FormClient.resources
?????文件??????28160??2019-01-17?13:37??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\obj\Debug\AsyncTcpClient.pdb
?????文件????????180??2019-01-17?13:37??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\obj\Debug\AsyncTcpClient.Properties.Resources.resources
?????文件????????753??2019-01-17?13:38??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????6227??2019-01-17?13:37??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件???????3584??2019-01-17?13:38??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
?????文件????????478??2006-01-19?18:22??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\Program.cs
?????文件???????1184??2006-01-18?09:08??TCP服務(C#的多線程多客戶端異步聊天通訊源碼)\AsyncTcpClient\AsyncTcpClient\Properties\AssemblyInfo.cs
............此處省略149個文件信息
- 上一篇:C#網頁爬蟲
- 下一篇:C# 實現CRC校驗算法源碼
評論
共有 條評論