use
IdTCPClient;function CanbeConnected(sHost: string; dwPort: Integer): Boolean;
var
Tcp: TIdTCPClient;
begin
Tcp := TIdTCPClient.Create;
Tcp.Host := sHost;
Tcp.Port := dwPort;
try
try
Tcp.Connect;
Result := True;
except
Result := False;
end;
finally
Tcp.Disconnect;
Tcp.Free;
end;
end;Tcp := TIdTCPClient.Create;
到了这里就编译不过去
IdTCPClient;function CanbeConnected(sHost: string; dwPort: Integer): Boolean;
var
Tcp: TIdTCPClient;
begin
Tcp := TIdTCPClient.Create;
Tcp.Host := sHost;
Tcp.Port := dwPort;
try
try
Tcp.Connect;
Result := True;
except
Result := False;
end;
finally
Tcp.Disconnect;
Tcp.Free;
end;
end;Tcp := TIdTCPClient.Create;
到了这里就编译不过去
client := TIdTCPClient.Create(nil);