资源简介
此代码是在C#的编程语言的基础上,可运行

代码片段和文件信息
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace myChatClient
{
public partial class client_main_form : Form
{
//登录的窗体
private Form1 register_form;
//与服务器的连接
TcpClient tcpClient;
//与服务器数据交互的流通道
private NetworkStream Stream;
//客服端信息
string[] user_info;
//客户端的状态
private static string CLOSED = “closed“;
private static string CONNECTED = “connected“;
private string state = CLOSED;
private bool stopFlag;
private Color color;
// This delegate enables asynchronous calls for setting
// the text property on a TextBox control.
delegate void SetTextCallback(string text);
delegate void SetTextCallback2(string[] tokens);
public client_main_form(Form1 register_form TcpClient tcpClient NetworkStream Stream string[] user_info)
{
InitializeComponent();
this.register_form = register_form;
this.tcpClient = tcpClient;
this.Stream = Stream;
this.user_info = user_info;
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
//更新在线用户列表
private void update_user_list(string[] tokens)
{
if (this.lstUsers.InvokeRequired)
{
SetTextCallback2 d = new SetTextCallback2(update_user_list);
this.Invoke(d new object[] { tokens });
}
else
{
lstUsers.Items.Clear();
for (int i = 1; i < tokens.Length - 1; i++)
{
lstUsers.Items.Add(tokens[i].Trim());
}
}
}
//添加在线用户列表
private void add_user_list(string[] tokens)
{
if (this.lstUsers.InvokeRequired)
{
SetTextCallback2 d = new SetTextCallback2(add_user_list);
this.Invoke(d new object[] { tokens });
}
else
{
this.lstUsers.Items.Add(tokens[1]);
}
}
private void add(string msg)
{
if (this.rtbMsg.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(add);
this.Invoke(d new object[] { msg });
}
else
{
if (!color.IsEmpty)
{
this.rtbMsg.SelectionColor = color;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 819200 2006-11-23 13:45 bk\myChatClient\myChatClient\bin\Debug\myChatClient.exe
文件 42496 2006-11-23 13:45 bk\myChatClient\myChatClient\bin\Debug\myChatClient.pdb
文件 5632 2005-12-08 14:51 bk\myChatClient\myChatClient\bin\Debug\myChatClient.vshost.exe
文件 118350 2006-11-21 11:10 bk\myChatClient\myChatClient\bin\Debug\Resources\中标1.BMP
文件 63438 2006-11-21 15:27 bk\myChatClient\myChatClient\bin\Debug\Resources\女.BMP
文件 63950 2006-11-21 10:55 bk\myChatClient\myChatClient\bin\Debug\Resources\小标.BMP
文件 62982 2006-11-21 10:58 bk\myChatClient\myChatClient\bin\Debug\Resources\男.BMP
文件 13965 2006-11-23 13:44 bk\myChatClient\myChatClient\client_main_form.cs
文件 12124 2006-11-23 13:27 bk\myChatClient\myChatClient\client_main_form.Designer.cs
文件 5814 2006-11-23 13:27 bk\myChatClient\myChatClient\client_main_form.resx
文件 5720 2006-11-23 02:52 bk\myChatClient\myChatClient\Form1.cs
文件 8195 2006-11-23 02:15 bk\myChatClient\myChatClient\Form1.Designer.cs
文件 5814 2006-11-23 02:15 bk\myChatClient\myChatClient\Form1.resx
文件 4345 2006-11-21 15:28 bk\myChatClient\myChatClient\myChatClient.csproj
文件 180 2006-11-23 13:32 bk\myChatClient\myChatClient\obj\Debug\myChatClient.client_main_form.resources
文件 1143 2006-11-23 13:32 bk\myChatClient\myChatClient\obj\Debug\myChatClient.csproj.GenerateResource.Cache
文件 819200 2006-11-23 13:45 bk\myChatClient\myChatClient\obj\Debug\myChatClient.exe
文件 180 2006-11-23 02:15 bk\myChatClient\myChatClient\obj\Debug\myChatClient.Form1.resources
文件 42496 2006-11-23 13:45 bk\myChatClient\myChatClient\obj\Debug\myChatClient.pdb
文件 477194 2006-11-21 15:28 bk\myChatClient\myChatClient\obj\Debug\myChatClient.Properties.Resources.resources
文件 118350 2006-11-21 11:10 bk\myChatClient\myChatClient\obj\Debug\myChatClient.Resources.中标1.BMP
文件 63438 2006-11-21 15:27 bk\myChatClient\myChatClient\obj\Debug\myChatClient.Resources.女.BMP
文件 63950 2006-11-21 10:55 bk\myChatClient\myChatClient\obj\Debug\myChatClient.Resources.小标.BMP
文件 62982 2006-11-21 10:58 bk\myChatClient\myChatClient\obj\Debug\myChatClient.Resources.男.BMP
文件 5120 2006-11-21 15:28 bk\myChatClient\myChatClient\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
文件 652 2006-11-23 13:46 bk\myChatClient\myChatClient\obj\myChatClient.csproj.FileList.txt
文件 478 2006-11-23 00:56 bk\myChatClient\myChatClient\Program.cs
文件 1172 2006-11-18 21:24 bk\myChatClient\myChatClient\Properties\AssemblyInfo.cs
文件 4338 2006-11-21 15:28 bk\myChatClient\myChatClient\Properties\Resources.Designer.cs
文件 7398 2006-11-21 15:28 bk\myChatClient\myChatClient\Properties\Resources.resx
............此处省略69个文件信息
- 上一篇:C#实现的WEB浏览器
- 下一篇:跑酷游戏源码
相关资源
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
评论
共有 条评论