tempname:=speaktocbx.text;
speaktocbx.clear;
speaktocbx.items.assign(listbox1.items);
speaktocbx.items.insert(0,'所有人');
for i:=0 to speaktocbx.items.count-1 do
begin
if speaktocbx.items[i]=tempname then break;
end;
if i>speaktocbx.items.count-1 then i:=0;
speaktocbx.itemindex:=i;
//////////////////////////////////////////////////////////////////
except //异常处理
on e:exception do
begin
timer1.enabled:=false;
application.messagebox
(pchar('通信中断或服务器故障,点确定后将关闭程序,请稍后重启动。详细中断原因:'+e.message),'dcomchatclient',mb_iconwarning);
application.terminate;
end;