简单多人聊天

简单多人聊天

ID:20619585

大小:55.00 KB

页数:17页

时间:2018-10-14

简单多人聊天_第1页
简单多人聊天_第2页
简单多人聊天_第3页
简单多人聊天_第4页
简单多人聊天_第5页
资源描述:

《简单多人聊天》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、简单的多人聊天(C#)/********************************8ChatServer:***********************/usingSystem;usingSystem.Drawing;usingSystem.Collections;usingSystem.ComponentModel;usingSystem.Windows.Forms;usingSystem.Data;usingSystem.Threading;usingSystem.Net.Sockets;usingSystem.Net;namespaceChat_

2、Server{ ///

 ///Form1的摘要说明。 /// publicclassForm1:System.Windows.Forms.Form {  ///  ///必需的设计器变量。  ///  privateSystem.ComponentModel.Containercomponents=null;  staticintlistenport=6666;  Socketclientsocket;  privateSystem.Windows.Forms.ListBoxlbCl

3、ients;  ArrayListclients;  privateSystem.Windows.Forms.Buttonbutton1;  Threadclientservice;  privateSystem.Windows.Forms.Labellabel1;  ThreadthreadListen;  publicForm1()  {      InitializeComponent();  }  ///

  ///清理所有正在使用的资源。  ///  protectedoverridevoidDispose(bo

4、oldisposing)  {   if(disposing)   {        if(clientservice!=null)    {     clientservice.Abort();    }    if(threadListen!=null)    {     try     {      threadListen.Abort();     }     catch(Exceptionex)     {      threadListen=null;     }    }        if(components!=null)    {    

5、 components.Dispose();    }   }   base.Dispose(disposing);     }  #regionWindows窗体设计器生成的代码  ///

  ///设计器支持所需的方法-不要使用代码编辑器修改  ///此方法的内容。  ///  privatevoidInitializeComponent()  {   this.lbClients=newSystem.Windows.Forms.ListBox();   this.button1=newSystem.Windows.F

6、orms.Button();   this.label1=newSystem.Windows.Forms.Label();   this.SuspendLayout();   //   //lbClients   //   this.lbClients.ItemHeight=12;   this.lbClients.Location=newSystem.Drawing.Point(16,24);   this.lbClients.Name="lbClients";   this.lbClients.Size=newSystem.Drawing.Size(18

7、4,268);   this.lbClients.TabIndex=0;   //   //button1   //   this.button1.Location=newSystem.Drawing.Point(272,56);   this.button1.Name="button1";   this.button1.TabIndex=1;   this.button1.Text="button1";   this.button1.Click+=newSystem.EventHandler(this.button1_Click);   //   //la

8、bel1   //   this.label1.Lo

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。