我不插网线这个错误无法捕捉procedure TbdComThread.Execute; begin { Place thread code here } FreeOnTerminate :=true; While b_EnRead do begin if Terminated then Break ; with frm_Main do begin if not IdTCPClient_MW100.Connected then begin try frm_Main.IdTCPClient_MW100.Connect(5000); b_Suc :=True ; Synchronize(buildCom); except b_Suc:=False ; b_EnSend :=True ; Synchronize(buildCom); IdTCPClient_MW100.Disconnect ; end; end; end; end; end;我现在这么写自动连接代码的
begin
{ Place thread code here }
FreeOnTerminate :=true; While b_EnRead do
begin
if Terminated then Break ;
with frm_Main do
begin
if not IdTCPClient_MW100.Connected then
begin
try
frm_Main.IdTCPClient_MW100.Connect(5000);
b_Suc :=True ;
Synchronize(buildCom);
except
b_Suc:=False ;
b_EnSend :=True ;
Synchronize(buildCom);
IdTCPClient_MW100.Disconnect ;
end;
end;
end;
end;
end;我现在这么写自动连接代码的