简单的多人聊天C#.Socket).docVIP

  • 7
  • 0
  • 约1.99万字
  • 约 20页
  • 2016-10-19 发布于贵州
  • 举报
简单的多人聊天C#.Socket)

/********************************8chatserver:*************************************************/ using system; using system.drawing; using system.collections; using ponentmodel; using system.windows.forms; using system.data; using system.threading; using .sockets; using ; namespace chat_server { ?/// summary ?/// form1 的摘要说明。 ?/// /summary ?public class form1 : system.windows.forms.form ?{ ??/// summary ??/// 必需的 ??/// /summary ??private ponentmodel.container components = null; ??static int listenport=6666; ??socket clientsocket; ??private system.windows.forms.listbox lbclients; ??arraylist clients; ??private system.windows.forms.button button1; ??thread clientservice; ??private system.windows.forms.label label1; ??thread threadlisten; ??public form1() ??{ ??? ???initializecomponent(); ??} ??/// summary ??/// 清理所有正在使用的资源。 ??/// /summary ??protected override void dispose( bool disposing ) ??{ ???if( disposing ) ???{ ???? ????if(clientservice != null) ????{ ?????clientservice.abort(); ????} ????if(threadlisten != null) ????{ ?????try ?????{ ??????threadlisten.abort(); ?????} ?????catch(exception ex) ?????{ ??????threadlisten = null; ?????} ????}???? ????if (components != null) ????{ ?????components.dispose(); ????} ???} ???base.dispose( disposing ); ??? ??} ??#region windows 窗体设计器生成的代码 ??/// summary ??/// 设计器支持所需的方法 - 不要使用代 ??/// 此方法的内容。 ??/// /summary ??private void initializecomponent() ??{ ???this.lbclients = new system.windows.forms.listbox(); ???this.button1 = new system.windows.forms.button(); ???this.label1 = new system.windows.forms.label(); ???this.suspendlayout(); ???// ???// lbclients ???// ???this.lbclients.itemheight = 12; ???this.lbclients.location = new system.drawing.point(16, 24); ??? = lbclients; ???this.lbclients.size = new system.drawing.size(184, 268); ???this.lbclients.tabindex = 0; ???// ???// button1 ???// ???this.button1.location = new system.drawing.point(272, 56); ??? = button1; ???this.button1.tabindex = 1; ???this.button1.text = button

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档