91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 119KB
    文件類型: .zip
    金幣: 2
    下載: 2 次
    發布日期: 2021-05-25
  • 語言: C#
  • 標簽:

資源簡介

C#編寫的局域網聊天軟件C#源碼C#編寫的局域網聊天軟件C#源碼C#編寫的局域網聊天軟件C#源碼C#編寫的局域網聊天軟件C#源碼C#編寫的局域網聊天軟件C#源碼C#編寫的局域網聊天軟件C#源碼C#編寫的局域網聊天軟件C#源碼C#編寫的局域網聊天軟件C#源碼C#編寫的局域網聊天軟件C#源碼

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
using?System.Net;
using?System.Net.Sockets;
using?System.Threading;

namespace?聊天2
{
????public?partial?class?Form1?:?Form
????{
????????private?UdpClient?receiveUdpClient;
????????private?UdpClient?sendUdpClient;
????????private??int?port;
????????IPAddress?ip;
????????IPAddress?remotIp;
????????public?Form1(int?Portstring?fip)
????????{
??????????
????????????this.port?=?Port;
????????????InitializeComponent();
????????????IPAddress[]?ips?=?Dns.GetHostAddresses(Dns.GetHostName());
????????????ip?=?ips[ips.Length?-?1];

????????????try
????????????{
????????????????remotIp?=?IPAddress.Parse(fip);
??????????????
????????????}
????????????catch?(Exception)
????????????{
????????????????remotIp?=?ip;
????????????}
???????????
????????????textBox3.Text?=?“您好!“;
????????????this.Text?=?“與“?+?fip?+?“聊天中“;

????????}

????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????Thread?myThread?=?new?Thread(ReceiveData);
????????????myThread.Start();
????????????textBox3.Focus();

????????}
????????private?void?ReceiveData()
????????{
????????????IPEndPoint?local?=?new?IPEndPoint(ip?port);
????????????receiveUdpClient?=?new?UdpClient(local);
????????????IPEndPoint?remote?=?new?IPEndPoint(IPAddress.Any?0);
????????????while?(true)
????????????{
????????????????try
????????????????{
????????????????????byte[]?receiveBytes?=?receiveUdpClient.Receive(ref?remote);
????????????????????string?receiveMessage?=?Encoding.Unicode.GetString(receiveBytes0receiveBytes.Length);
????????????????????AddItem(listBox1string.Format(“來自{0}:{1}“remote?receiveMessage));

????????????????????
????????????????}
????????????????catch?(Exception)
????????????????{

????????????????????break;
????????????????}
????????????}
????????}
????????delegate?void?AddListBoxItemDelegate(ListBox?listBoxstring?text);
????????private?void?AddItem(ListBox?listBox?string?text)
????????{
????????????if?(listBox.InvokeRequired)
????????????{
????????????????AddListBoxItemDelegate?d?=?AddItem;
????????????????listBox.Invoke(d?new?object[]?{?listBox?text?});

????????????}
????????????else
????????????{
????????????????listBox.Items.Add(text);
????????????????listBox.SelectedIndex?=?listBox.Items.Count?-?1;
????????????????listBox.ClearSelected();
????????????}
????????}
????????delegate?void?ClearTextBoxDelegate();
????????private?void?ClearTextBox()
????????{
????????????if?(textBox3.InvokeRequired)
????????????{
????????????????ClearTextBoxDelegate?d?=?ClearTextBox;
????????????????textBox3.Invoke(d);

????????????}
????????????else
????????????{
????????????????textBox3.Clear();
????????????????textBox3.Focus();
????????????}
????????}

????????private?void?button1_Click(object?

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2011-03-06?16:13??類飛秋聊天軟件\
?????目錄???????????0??2011-03-04?19:43??類飛秋聊天軟件\聊天2\
?????目錄???????????0??2011-03-06?16:02??類飛秋聊天軟件\聊天2\聊天2\
?????文件?????????911??2011-03-04?19:43??類飛秋聊天軟件\聊天2\聊天2.sln
?????文件???????13824??2011-03-05?11:23??類飛秋聊天軟件\聊天2\聊天2.suo
?????目錄???????????0??2011-03-04?19:43??類飛秋聊天軟件\聊天2\聊天2\bin\
?????目錄???????????0??2011-03-04?20:32??類飛秋聊天軟件\聊天2\聊天2\bin\Debug\
?????文件???????11776??2011-03-06?16:02??類飛秋聊天軟件\聊天2\聊天2\bin\Debug\聊天2.exe
?????文件???????28160??2011-03-06?16:02??類飛秋聊天軟件\聊天2\聊天2\bin\Debug\聊天2.pdb
?????文件???????14328??2011-03-06?14:29??類飛秋聊天軟件\聊天2\聊天2\bin\Debug\聊天2.vshost.exe
?????文件?????????490??2007-07-21?01:33??類飛秋聊天軟件\聊天2\聊天2\bin\Debug\聊天2.vshost.exe.manifest
?????文件????????3966??2011-03-06?16:02??類飛秋聊天軟件\聊天2\聊天2\Form1.cs
?????文件????????5769??2011-03-05?14:50??類飛秋聊天軟件\聊天2\聊天2\Form1.Designer.cs
?????文件????????5814??2011-03-05?14:50??類飛秋聊天軟件\聊天2\聊天2\Form1.resx
?????目錄???????????0??2011-03-04?19:43??類飛秋聊天軟件\聊天2\聊天2\obj\
?????目錄???????????0??2011-03-06?16:02??類飛秋聊天軟件\聊天2\聊天2\obj\Debug\
?????目錄???????????0??2011-03-04?19:43??類飛秋聊天軟件\聊天2\聊天2\obj\Debug\TempPE\
?????文件?????????748??2011-03-06?14:29??類飛秋聊天軟件\聊天2\聊天2\obj\Debug\聊天2.csproj.FileListAbsolute.txt
?????文件?????????847??2011-03-05?14:50??類飛秋聊天軟件\聊天2\聊天2\obj\Debug\聊天2.csproj.GenerateResource.Cache
?????文件???????11776??2011-03-06?16:02??類飛秋聊天軟件\聊天2\聊天2\obj\Debug\聊天2.exe
?????文件?????????180??2011-03-05?14:50??類飛秋聊天軟件\聊天2\聊天2\obj\Debug\聊天2.Form1.resources
?????文件???????28160??2011-03-06?16:02??類飛秋聊天軟件\聊天2\聊天2\obj\Debug\聊天2.pdb
?????文件?????????180??2011-03-05?14:50??類飛秋聊天軟件\聊天2\聊天2\obj\Debug\聊天2.Properties.Resources.resources
?????文件?????????502??2011-03-05?15:25??類飛秋聊天軟件\聊天2\聊天2\Program.cs
?????目錄???????????0??2011-03-04?19:43??類飛秋聊天軟件\聊天2\聊天2\Properties\
?????文件????????1356??2011-03-04?19:43??類飛秋聊天軟件\聊天2\聊天2\Properties\AssemblyInfo.cs
?????文件????????2864??2011-03-04?19:43??類飛秋聊天軟件\聊天2\聊天2\Properties\Resources.Designer.cs
?????文件????????5612??2011-03-04?19:43??類飛秋聊天軟件\聊天2\聊天2\Properties\Resources.resx
?????文件????????1092??2011-03-04?19:43??類飛秋聊天軟件\聊天2\聊天2\Properties\Settings.Designer.cs
?????文件?????????249??2011-03-04?19:43??類飛秋聊天軟件\聊天2\聊天2\Properties\Settings.settings
?????文件????????3760??2011-03-05?14:50??類飛秋聊天軟件\聊天2\聊天2\聊天2.csproj
............此處省略41個文件信息

評論

共有 條評論

相關資源