資源簡介
可以內外網通訊,公網放置服務器端,兩個內網放置客戶端就可以使兩個內網聊天,可發送文件,發送震動
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Drawing;
using?System.IO;
using?System.Net;
using?System.Net.Sockets;
using?System.Text;
using?System.Threading;
using?System.Windows.Forms;
namespace?Client
{
????public?partial?class?Client?:?Form
????{
????????//客戶端通信套接字
????????private?Socket?clientSocket;
????????//新線程
????????private?Thread?thread;
????????//當前登錄的用戶
????????private?string?userName?=?““;
????????private?string?friend;
????????private?string?filePath;
????????public?Client()
????????{
????????????InitializeComponent();
????????????//防止新線程調用主線程卡死
????????????CheckForIllegalCrossThreadCalls?=?false;
????????}
????????//通過IP地址與端口號與服務端建立鏈接???????
????????private?void?btnToServer_Click(object?sender?EventArgs?e)
????????{
???????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????187??2016-04-16?19:34??MySocket(3)\Client\App.config
?????文件??????18432??2018-03-15?14:40??MySocket(3)\Client\bin\Debug\Client.exe
?????文件????????187??2016-04-16?19:34??MySocket(3)\Client\bin\Debug\Client.exe.config
?????文件??????34304??2018-03-15?14:40??MySocket(3)\Client\bin\Debug\Client.pdb
?????文件??????22984??2018-03-15?14:08??MySocket(3)\Client\bin\Debug\Client.vshost.exe
?????文件????????187??2016-04-16?19:34??MySocket(3)\Client\bin\Debug\Client.vshost.exe.config
?????文件????????490??2010-03-17?22:39??MySocket(3)\Client\bin\Debug\Client.vshost.exe.manifest
?????文件??????12678??2016-05-07?19:14??MySocket(3)\Client\Client.cs
?????文件???????3876??2016-05-07?15:02??MySocket(3)\Client\Client.csproj
?????文件??????11423??2016-05-07?19:14??MySocket(3)\Client\Client.Designer.cs
?????文件???????5817??2016-05-07?19:14??MySocket(3)\Client\Client.resx
?????文件???????3877??2016-05-07?15:03??MySocket(3)\Client\Message.cs
?????文件????????410??2016-05-07?16:29??MySocket(3)\Client\MsgTypeEnum.cs
?????文件????????180??2018-03-15?14:40??MySocket(3)\Client\obj\Debug\Client.Client.resources
?????文件???????2611??2018-03-15?14:40??MySocket(3)\Client\obj\Debug\Client.csproj.FileListAbsolute.txt
?????文件????????976??2018-03-15?14:40??MySocket(3)\Client\obj\Debug\Client.csproj.GenerateResource.Cache
?????文件???????2209??2018-03-15?14:40??MySocket(3)\Client\obj\Debug\Client.csprojResolveAssemblyReference.cache
?????文件??????18432??2018-03-15?14:40??MySocket(3)\Client\obj\Debug\Client.exe
?????文件??????34304??2018-03-15?14:40??MySocket(3)\Client\obj\Debug\Client.pdb
?????文件????????180??2018-03-15?14:40??MySocket(3)\Client\obj\Debug\Client.Properties.Resources.resources
?????文件???????1308??2016-05-07?09:49??MySocket(3)\Client\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????6983??2018-03-15?11:30??MySocket(3)\Client\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件??????????0??2016-04-16?19:34??MySocket(3)\Client\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
?????文件??????????0??2016-04-16?19:34??MySocket(3)\Client\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
?????文件??????????0??2016-04-16?19:34??MySocket(3)\Client\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
?????文件????????169??2016-04-18?16:38??MySocket(3)\Client\obj\Debug\客戶端.csproj.FileListAbsolute.txt
?????文件????????519??2016-04-16?19:35??MySocket(3)\Client\Program.cs
?????文件???????1350??2016-04-16?19:34??MySocket(3)\Client\Properties\AssemblyInfo.cs
?????文件???????2864??2016-04-16?19:34??MySocket(3)\Client\Properties\Resources.Designer.cs
?????文件???????5612??2016-04-16?19:34??MySocket(3)\Client\Properties\Resources.resx
............此處省略59個文件信息
- 上一篇:UPD打洞(含服務端代碼)
- 下一篇:C# SOCKET編寫的簡單聊天通信程序
評論
共有 條評論