求delphi7.0 下socket客户端对客户端一对一聊天代码,只用serversocket和clientsocket 实现 求delphi7.0 下socket客户端对客户端一对一聊天代码,只用serversocket和clientsocket 实现,,客户端多个都要和其中一个聊天时,要排队,得到允许才可聊天。有代码的可发我邮箱:[email protected] 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 好像在DELPHI盒子里面有看到过,自己去找找吧。。 demo裡也應該有實現的效果吧? zlchat是一个网页视频会议软件,使用它你可以与远方的亲朋好友视频聊天,也可以用于公司远程视频会议,远程视频教学。zlchat 没有使用任何activex插件,不用安装客户端,打开网页就可能使用。 1.不限制房间,用户数 2.每个房间最高可达50人,一台服务器最高可支持1000人同时在线 3.普通ADSL可以同时看10路用户视频 4.费版本永远不收费,不过期 5.完全跨平台,支持windows,linux,unix服务器。 unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, IdIPMCastServer, IdBaseComponent, IdComponent, IdIPMCastBase, FunLIB,IdIPMCastClient,IdSocketHandle, StdCtrls, ExtCtrls, IdTCPServer, IdTCPConnection, IdTCPClient;type TForm1 = class(TForm) Memo1: TMemo; Memo2: TMemo; ListBox1: TListBox; Button1: TButton; Button2: TButton; IdIPMCastClient1: TIdIPMCastClient; IdIPMCastServer1: TIdIPMCastServer; Label1: TLabel; Label2: TLabel; Button3: TButton; Image1: TImage; IdTCPClient1: TIdTCPClient; IdTCPServer1: TIdTCPServer; Image2: TImage; procedure Button2Click(Sender: TObject); procedure IdIPMCastClient1IPMCastRead(Sender: TObject; AData: TStream; ABinding: TIdSocketHandle); procedure Button1Click(Sender: TObject); procedure CastMyIP; procedure FormCreate(Sender: TObject); procedure Button3Click(Sender: TObject); procedure IdTCPServer1Execute(AThread: TIdPeerThread); private { Private declarations } public LocalIP:String; { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button2Click(Sender: TObject);begin IdIPMCastServer1.Send('1');end;procedure TForm1.IdIPMCastClient1IPMCastRead(Sender: TObject; AData: TStream; ABinding: TIdSocketHandle);var IP:String; Port:Integer; Bf:TStringStream; ProgId,k:Integer; MsgTxt,DestIP:String;begin //对方传入机器IP地址 及 端口号 IP :=ABinding.PeerIP; Port := ABinding.PeerPort; bf := TStringStream.Create(''); bf.CopyFrom(AData,0); if bf.DataString<>'' then begin ProgId:=StrToInt(copy(bf.DataString,1,1)); case ProgId of 1: begin //请求IP回应 CastMyIP; end; 2: begin //接收 k := pos('*',bf.DataString); DestIP := copy(bf.DataString,2,k-2); //取目标IP if DestIP=LocalIP then //判断信息是否是发给自己IP的 begin msgTxt := copy(bf.DataString,2,length(bf.DataString)-1); Memo2.Lines.Add(IP+':'+msgTxt); end; end; //在列表中添加接收到的IP地址 3 : begin for k:=0 to ListBox1.Items.Count-1 do if ListBox1.Items[k]=IP then exit; ListBox1.Items.Add(IP); end; end; end;end;procedure TForm1.Button1Click(Sender: TObject);begin //发送信息 自定义信息格式 "2+IP+*+信息体" IdIPMCastServer1.Send('2'+ListBox1.Items[ListBox1.ItemIndex]+'*'+Memo1.Text);end;procedure TForm1.CastMyIP;begin //在局域网中公告自己的IP地址 IdIPMCastServer1.Send('3');end;procedure TForm1.FormCreate(Sender: TObject);begin LocalIP := GetLocalIP; CastMyIP;end;procedure TForm1.Button3Click(Sender: TObject);var bf,bmpBf:TMemoryStream; StrBf:TStringStream;begin Image1.Picture.Bitmap.LoadFromFile('c:\111.bmp'); bmpBf := TMemoryStream.Create; Image1.Picture.Bitmap.SaveToStream(bmpBf); IdTCPClient1.Host := ListBox1.Items[ListBox1.ItemIndex]; if IdTCPClient1.Connected then IdTCPCLient1.Disconnect; IdTCPClient1.Connect(1000); IdTCPCLient1.WriteStream(bmpBf,true,true,bmpBf.Size); idTCPClient1.Disconnect;end;procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);var bf :TMemoryStream;begin bf := TMemoryStream.Create; AThread.Connection.ReadStream(bf,-1); bf.Position := 0; Image2.Picture.Bitmap.LoadFromStream(bf);end;end. 服务器端: procedure TForm1.ServerSocket1Accept(Sender: TObject; Socket: TCustomWinSocket); var newitem:TListItem; ii,jj:Integer; user,usercur:string; begin newitem:=ListView1.Items.Insert(ListView1.Items.Count); newitem.Caption:= 'Client: '+IntToStr(ListView1.Items.Count); newitem.SubItems.Add(Socket.RemoteHost); newitem.SubItems.Add(Socket.RemoteAddress); newitem.SubItems.Add(IntToStr(Socket.RemotePort)); //将远程新登录客户显示到列表 //ListView1.AlphaSort(); ListView1.Items.Item[ListView1.Items.Count-1].Selected:=true;//选中添加的客户 Display( '连接到主机: '+Socket.RemoteAddress+ ' 成功 '); ii:=ListView1.ItemIndex; Richedit1.Lines.Add(DateToStr(Date)+ ' '+TimeToStr(time)+ '== > > '+ ListView1.Items[ii].Caption+ '加入进来! '); //显示什么日期时间某某加入进来 user := listview1.Items[ii].Caption + '^ ' + listview1.Items[ii].SubItems[0] + '^ ' + listview1.Items[ii].SubItems[1] + '^ ' + listview1.Items[ii].SubItems[2]; for jj := 0 to listview1.Items.Count - 1 do begin serversocket1.Socket.Connections[jj].SendText( '增加用户@#!^ ' + user + '^ '); //发送增加用户某某给其他各个客户端 end; for jj := 0 to listview1.Items.Count - 2 do begin user := listview1.Items[jj].Caption + '^ ' + listview1.Items[jj].SubItems[0] + '^ ' + listview1.Items[jj].SubItems[1] + '^ ' + listview1.Items[jj].SubItems[2]; serversocket1.Socket.Connections[ii].SendText( '增加用户@#!^ ' + user + '^ '); end; end; procedure TForm1.ServerSocket1ClientDisconnect(Sender: TObject; Socket: TCustomWinSocket); var ii,jj:integer; User:String; begin for ii:=0 to ListView1.Items.Count-1 do begin if ListView1.Items.Item[ii].SubItems.Strings[2]=IntToStr(Socket.RemotePort) then begin//当有用户离开时发送类似信息给各个客户端 for jj:=0 to ListView1.Items.Count -1 do begin user:=ListView1.Items[ii].Caption+ '^ '+ListView1.Items[ii].subitems[0]+ '^ '+ ListView1.Items[ii].SubItems[1]+ '^ '+ListView1.Items[ii].subitems[2]; ServerSocket1.Socket.Connections[jj].SendText( '删除用户@#!^ '+User+ '^ '); end; Richedit1.Lines.Add(DateToStr(Date)+ ' '+TimeToStr(time)+ '== > > '+ ListView1.Items[ii].Caption+ '走了! '); ListView1.Items.Item[ii].Delete(); Display(Socket.RemoteHost+ '走了 ');//显示某某在什么时间走了 end; end; if ListView1.Items.Count=0 then begin Display( '获取信息...... ');//如果用户列表为空则显示正在获取信息 end; end; procedure TForm1.ServerSocket1ClientRead(Sender: TObject; Socket: TCustomWinSocket); var tmpstr,User:string; ii,jj:integer; ListItem:TListItem; exist:bool; begin exist:=False; tmpstr:=Socket.ReceiveText; if getmaskstring(tmpstr, '^ ',1)= '交谈@#! ' then begin //根据收到的字符串显示某某在交谈 for jj:=0 to ListView1.Items.Count -1 do begin user:=getmaskstring(tmpstr, '^ ',2); ServerSocket1.Socket.Connections[jj].SendText( '交谈@#!^ '+User+ '^ '); end; Richedit1.Lines.Add(getmaskstring(tmpstr, '^ ',2));//显示交谈客户内容 end; if getmaskstring(tmpstr, '^ ',1)= '昵称@#! ' then begin//如果收到的是昵称而不是交谈信息,则说明用户发送过来的是更改昵称的信息 for ii:=0 to ListView1.Items.Count-1 do begin if Socket.RemotePort=StrToInt(ListView1.Items[ii].SubItems[2]) then begin exist:=true; if getmaskstring(tmpstr, '^ ',2) < >ListView1.Items[ii].Caption then begin Richedit1.Lines.Add(DateToStr(Date)+ ' '+TimeToStr(time)+ '== > > '+ ListView1.Items[ii].Caption+ ' 更名为 '+ getmaskstring(tmpstr, '^ ',2)); ListView1.Items[ii].Caption:=getmaskstring(tmpstr, '^ ',2);//显示更名为某某 for jj:=0 to ListView1.Items.Count -1 do begin user:=ListView1.Items[ii].Caption+ '^ '+ListView1.Items[ii].subitems[0]+ '^ '+ ListView1.Items[ii].SubItems[1]+ '^ '+ListView1.Items[ii].subitems[2]; ServerSocket1.Socket.Connections[jj].SendText( '昵称@#!^ '+User+ '^ ');//通知各个客户端某用户改名后的昵称,以便在客户端更新昵称 end; end; end; end; end; end; 客户端: procedure TForm1.ClientSocket1Read(Sender: TObject; Socket: TCustomWinSocket); var tmpstr:string; newItem:TListItem; ii:Integer; exist:bool; commHead:string; begin exist:=false; tmpstr:=Socket.ReceiveText; commHead:=getmaskstring(tmpstr, '^ ',1); //Richedit1.Lines.Add(tmpstr); if commHead = '昵称@#! 'then //如果客户端收到的是昵称 begin for ii:=0 to ListView1.Items.Count -1 do begin if getmaskstring(tmpstr, '^ ',5)=ListView1.Items[ii].SubItems[2] then begin exist:=true; if getmaskstring(tmpstr, '^ ',2) < >ListView1.Items[ii].Caption then begin Richedit1.Lines.Add(DateToStr(Date)+ ' '+TimeToStr(time)+ '== > > '+ ListView1.Items[ii].Caption+ ' 更名为 '+ getmaskstring(tmpstr, '^ ',2)); ListView1.Items[ii].Caption:=getmaskstring(tmpstr, '^ ',2);//更改客户端客户的昵称 end; end; end; end; if commHead= '交谈@#! 'then//如果收到的是交谈信息,则显示交谈信息 begin Richedit1.Lines.Add(getmaskstring(tmpstr, '^ ',2)); end; if commHead= '增加用户@#! 'then //如果收到的是增加用户的信息,个在在线用户列表中添加该用户 begin for ii:=0 to ListView1.Items.Count-1 do begin if getmaskstring(tmpstr, '^ ',5)=ListView1.Items[ii].SubItems[2] then exist:=true; end; if exist=false then begin newitem:=ListView1.Items.add(); newitem.Caption:=getmaskstring(tmpstr, '^ ',2); newitem.SubItems.Add(getmaskstring(tmpstr, '^ ',3)); newitem.SubItems.Add(getmaskstring(tmpstr, '^ ',4)); newitem.SubItems.Add(getmaskstring(tmpstr, '^ ',5)); Richedit1.Lines.Add(DateToStr(Date)+ ' '+TimeToStr(time)+ '== > > '+ getmaskstring(tmpstr, '^ ',2)+ '加入进来! ');//显示某人在什么时间加入进来 end; end; if commHead= '删除用户@#! 'then //如果收到的删除用户信息,则在在线列表中删除该用户昵称 begin for ii:=0 to ListView1.Items.Count-1 do begin if getmaskstring(tmpstr, '^ ',5)=ListView1.Items[ii].SubItems[2] then begin Listview1.Items.Delete(ii); Richedit1.Lines.Add(DateToStr(Date)+ ' '+TimeToStr(time)+ '== > > '+ getmaskstring(tmpstr, '^ ',2)+ '走了! '); //显示什么时间某某用户走了 end; end; end; end; [继续]vc代码转delphi 数据库异常处理的方法 学delphi遇到的错误 区别在哪~ 小弟DELPHI刚入门,谁能帮忙解答一个小小的问题啊? 请教quickreport一个打印的问题! 数据控件问题 如何获得窗体的句柄 超级菜鸟求救:200分求鼠标拖动画弧的源代码。 关于windows中的名词术语 tobject类型转换的问题 函数返回值老是无效,代码如下
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdIPMCastServer, IdBaseComponent, IdComponent, IdIPMCastBase,
FunLIB,IdIPMCastClient,IdSocketHandle, StdCtrls, ExtCtrls, IdTCPServer,
IdTCPConnection, IdTCPClient;type
TForm1 = class(TForm)
Memo1: TMemo;
Memo2: TMemo;
ListBox1: TListBox;
Button1: TButton;
Button2: TButton;
IdIPMCastClient1: TIdIPMCastClient;
IdIPMCastServer1: TIdIPMCastServer;
Label1: TLabel;
Label2: TLabel;
Button3: TButton;
Image1: TImage;
IdTCPClient1: TIdTCPClient;
IdTCPServer1: TIdTCPServer;
Image2: TImage;
procedure Button2Click(Sender: TObject);
procedure IdIPMCastClient1IPMCastRead(Sender: TObject; AData: TStream;
ABinding: TIdSocketHandle);
procedure Button1Click(Sender: TObject);
procedure CastMyIP;
procedure FormCreate(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure IdTCPServer1Execute(AThread: TIdPeerThread);
private
{ Private declarations }
public
LocalIP:String;
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button2Click(Sender: TObject);
begin
IdIPMCastServer1.Send('1');
end;procedure TForm1.IdIPMCastClient1IPMCastRead(Sender: TObject;
AData: TStream; ABinding: TIdSocketHandle);
var
IP:String;
Port:Integer;
Bf:TStringStream;
ProgId,k:Integer;
MsgTxt,DestIP:String;
begin
//对方传入机器IP地址 及 端口号
IP :=ABinding.PeerIP;
Port := ABinding.PeerPort;
bf := TStringStream.Create('');
bf.CopyFrom(AData,0); if bf.DataString<>'' then
begin
ProgId:=StrToInt(copy(bf.DataString,1,1));
case ProgId of
1: begin
//请求IP回应
CastMyIP;
end;
2: begin
//接收
k := pos('*',bf.DataString);
DestIP := copy(bf.DataString,2,k-2); //取目标IP
if DestIP=LocalIP then //判断信息是否是发给自己IP的
begin
msgTxt := copy(bf.DataString,2,length(bf.DataString)-1);
Memo2.Lines.Add(IP+':'+msgTxt);
end;
end; //在列表中添加接收到的IP地址
3 : begin
for k:=0 to ListBox1.Items.Count-1 do
if ListBox1.Items[k]=IP then exit;
ListBox1.Items.Add(IP);
end; end;
end;end;procedure TForm1.Button1Click(Sender: TObject);
begin
//发送信息 自定义信息格式 "2+IP+*+信息体"
IdIPMCastServer1.Send('2'+ListBox1.Items[ListBox1.ItemIndex]+'*'+Memo1.Text);
end;procedure TForm1.CastMyIP;
begin
//在局域网中公告自己的IP地址
IdIPMCastServer1.Send('3');
end;procedure TForm1.FormCreate(Sender: TObject);
begin
LocalIP := GetLocalIP;
CastMyIP;
end;procedure TForm1.Button3Click(Sender: TObject);
var
bf,bmpBf:TMemoryStream;
StrBf:TStringStream;
begin
Image1.Picture.Bitmap.LoadFromFile('c:\111.bmp');
bmpBf := TMemoryStream.Create;
Image1.Picture.Bitmap.SaveToStream(bmpBf);
IdTCPClient1.Host := ListBox1.Items[ListBox1.ItemIndex];
if IdTCPClient1.Connected then IdTCPCLient1.Disconnect;
IdTCPClient1.Connect(1000);
IdTCPCLient1.WriteStream(bmpBf,true,true,bmpBf.Size);
idTCPClient1.Disconnect;
end;procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);
var
bf :TMemoryStream;
begin
bf := TMemoryStream.Create;
AThread.Connection.ReadStream(bf,-1);
bf.Position := 0;
Image2.Picture.Bitmap.LoadFromStream(bf);
end;end.
Socket: TCustomWinSocket);
var
newitem:TListItem;
ii,jj:Integer;
user,usercur:string;
begin
newitem:=ListView1.Items.Insert(ListView1.Items.Count);
newitem.Caption:= 'Client: '+IntToStr(ListView1.Items.Count);
newitem.SubItems.Add(Socket.RemoteHost);
newitem.SubItems.Add(Socket.RemoteAddress);
newitem.SubItems.Add(IntToStr(Socket.RemotePort)); //将远程新登录客户显示到列表
//ListView1.AlphaSort();
ListView1.Items.Item[ListView1.Items.Count-1].Selected:=true;//选中添加的客户
Display( '连接到主机: '+Socket.RemoteAddress+ ' 成功 ');
ii:=ListView1.ItemIndex;
Richedit1.Lines.Add(DateToStr(Date)+ ' '+TimeToStr(time)+ '== > > '+
ListView1.Items[ii].Caption+ '加入进来! '); //显示什么日期时间某某加入进来
user := listview1.Items[ii].Caption + '^ ' +
listview1.Items[ii].SubItems[0] + '^ '
+ listview1.Items[ii].SubItems[1] + '^ '
+ listview1.Items[ii].SubItems[2];
for jj := 0 to listview1.Items.Count - 1 do
begin
serversocket1.Socket.Connections[jj].SendText( '增加用户@#!^ ' +
user + '^ '); //发送增加用户某某给其他各个客户端
end;
for jj := 0 to listview1.Items.Count - 2 do
begin
user := listview1.Items[jj].Caption + '^ ' +
listview1.Items[jj].SubItems[0] + '^ '
+ listview1.Items[jj].SubItems[1] + '^ '
+ listview1.Items[jj].SubItems[2];
serversocket1.Socket.Connections[ii].SendText( '增加用户@#!^ ' +
user + '^ ');
end;
end;
procedure TForm1.ServerSocket1ClientDisconnect(Sender: TObject;
Socket: TCustomWinSocket);
var
ii,jj:integer;
User:String;
begin
for ii:=0 to ListView1.Items.Count-1 do begin
if ListView1.Items.Item[ii].SubItems.Strings[2]=IntToStr(Socket.RemotePort) then begin//当有用户离开时发送类似信息给各个客户端
for jj:=0 to ListView1.Items.Count -1 do begin
user:=ListView1.Items[ii].Caption+ '^ '+ListView1.Items[ii].subitems[0]+ '^ '+
ListView1.Items[ii].SubItems[1]+ '^ '+ListView1.Items[ii].subitems[2];
ServerSocket1.Socket.Connections[jj].SendText( '删除用户@#!^ '+User+ '^ ');
end;
Richedit1.Lines.Add(DateToStr(Date)+ ' '+TimeToStr(time)+ '== > > '+
ListView1.Items[ii].Caption+ '走了! ');
ListView1.Items.Item[ii].Delete();
Display(Socket.RemoteHost+ '走了 ');//显示某某在什么时间走了
end;
end;
if ListView1.Items.Count=0 then begin
Display( '获取信息...... ');//如果用户列表为空则显示正在获取信息
end;
end; procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
Socket: TCustomWinSocket);
var
tmpstr,User:string;
ii,jj:integer;
ListItem:TListItem;
exist:bool;
begin
exist:=False;
tmpstr:=Socket.ReceiveText;
if getmaskstring(tmpstr, '^ ',1)= '交谈@#! ' then begin //根据收到的字符串显示某某在交谈
for jj:=0 to ListView1.Items.Count -1 do begin
user:=getmaskstring(tmpstr, '^ ',2);
ServerSocket1.Socket.Connections[jj].SendText( '交谈@#!^ '+User+ '^ ');
end;
Richedit1.Lines.Add(getmaskstring(tmpstr, '^ ',2));//显示交谈客户内容
end;
if getmaskstring(tmpstr, '^ ',1)= '昵称@#! ' then begin//如果收到的是昵称而不是交谈信息,则说明用户发送过来的是更改昵称的信息
for ii:=0 to ListView1.Items.Count-1 do begin
if Socket.RemotePort=StrToInt(ListView1.Items[ii].SubItems[2])
then begin
exist:=true;
if getmaskstring(tmpstr, '^ ',2) < >ListView1.Items[ii].Caption then
begin
Richedit1.Lines.Add(DateToStr(Date)+ ' '+TimeToStr(time)+ '== > > '+
ListView1.Items[ii].Caption+ ' 更名为 '+
getmaskstring(tmpstr, '^ ',2));
ListView1.Items[ii].Caption:=getmaskstring(tmpstr, '^ ',2);//显示更名为某某
for jj:=0 to ListView1.Items.Count -1 do begin
user:=ListView1.Items[ii].Caption+ '^ '+ListView1.Items[ii].subitems[0]+ '^ '+ ListView1.Items[ii].SubItems[1]+ '^ '+ListView1.Items[ii].subitems[2];
ServerSocket1.Socket.Connections[jj].SendText( '昵称@#!^ '+User+ '^ ');//通知各个客户端某用户改名后的昵称,以便在客户端更新昵称
end;
end;
end;
end;
end;
end; 客户端: procedure TForm1.ClientSocket1Read(Sender: TObject;
Socket: TCustomWinSocket);
var
tmpstr:string;
newItem:TListItem;
ii:Integer;
exist:bool;
commHead:string;
begin
exist:=false;
tmpstr:=Socket.ReceiveText;
commHead:=getmaskstring(tmpstr, '^ ',1);
//Richedit1.Lines.Add(tmpstr);
if commHead = '昵称@#! 'then //如果客户端收到的是昵称
begin
for ii:=0 to ListView1.Items.Count -1 do
begin
if getmaskstring(tmpstr, '^ ',5)=ListView1.Items[ii].SubItems[2]
then
begin
exist:=true;
if getmaskstring(tmpstr, '^ ',2) < >ListView1.Items[ii].Caption then
begin
Richedit1.Lines.Add(DateToStr(Date)+ ' '+TimeToStr(time)+ '== > > '+
ListView1.Items[ii].Caption+ ' 更名为 '+
getmaskstring(tmpstr, '^ ',2));
ListView1.Items[ii].Caption:=getmaskstring(tmpstr, '^ ',2);//更改客户端客户的昵称 end;
end;
end;
end;
if commHead= '交谈@#! 'then//如果收到的是交谈信息,则显示交谈信息
begin
Richedit1.Lines.Add(getmaskstring(tmpstr, '^ ',2));
end;
if commHead= '增加用户@#! 'then //如果收到的是增加用户的信息,个在在线用户列表中添加该用户
begin
for ii:=0 to ListView1.Items.Count-1 do
begin
if getmaskstring(tmpstr, '^ ',5)=ListView1.Items[ii].SubItems[2] then
exist:=true;
end;
if exist=false then begin
newitem:=ListView1.Items.add();
newitem.Caption:=getmaskstring(tmpstr, '^ ',2);
newitem.SubItems.Add(getmaskstring(tmpstr, '^ ',3));
newitem.SubItems.Add(getmaskstring(tmpstr, '^ ',4));
newitem.SubItems.Add(getmaskstring(tmpstr, '^ ',5));
Richedit1.Lines.Add(DateToStr(Date)+ ' '+TimeToStr(time)+ '== > > '+
getmaskstring(tmpstr, '^ ',2)+ '加入进来! ');//显示某人在什么时间加入进来 end;
end;
if commHead= '删除用户@#! 'then //如果收到的删除用户信息,则在在线列表中删除该用户昵称
begin
for ii:=0 to ListView1.Items.Count-1 do
begin
if getmaskstring(tmpstr, '^ ',5)=ListView1.Items[ii].SubItems[2] then
begin
Listview1.Items.Delete(ii);
Richedit1.Lines.Add(DateToStr(Date)+ ' '+TimeToStr(time)+ '== > > '+
getmaskstring(tmpstr, '^ ',2)+ '走了! '); //显示什么时间某某用户走了 end;
end;
end;
end;