X
xiaong
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.IdTCPServer1Connect(AThread: TIdPeerThread);
var
item:TListItem;
strIp:string;
aDate,aTime:TDateTime;
aDateTime:string;
nIndex:integer;
begin
strIp:=AThread.Connection.Socket.Binding.PeerIP;
//ShowMessage(strIp);
listView1.Canvas.Lock;
try
nIndex:=SeekListViewByIp(strIp);
if nIndex=-1 then
begin
item:=listView1.Items.Add;
item.Caption:=strIp;
aTime:=Time();
aDate:=Date();
aDateTime:=DateToStr(aDate)+' '+TimeToStr(aTime);
item.SubItems.Add(aDateTime);
item.SubItems.Add(aDateTime);
end;
finally
listView1.Canvas.Unlock;
end;
end;
当运行至item.caption:=strIP时,程序停止响应,搞不明白是怎么回事?
var
item:TListItem;
strIp:string;
aDate,aTime:TDateTime;
aDateTime:string;
nIndex:integer;
begin
strIp:=AThread.Connection.Socket.Binding.PeerIP;
//ShowMessage(strIp);
listView1.Canvas.Lock;
try
nIndex:=SeekListViewByIp(strIp);
if nIndex=-1 then
begin
item:=listView1.Items.Add;
item.Caption:=strIp;
aTime:=Time();
aDate:=Date();
aDateTime:=DateToStr(aDate)+' '+TimeToStr(aTime);
item.SubItems.Add(aDateTime);
item.SubItems.Add(aDateTime);
end;
finally
listView1.Canvas.Unlock;
end;
end;
当运行至item.caption:=strIP时,程序停止响应,搞不明白是怎么回事?