Hi, ich kriege immer einen Scketfehler, liegt bestimmt an try expect?!
Delphi-Quellcode:
function Ping(Host:
String):
string;
var res: TReplyStatus;
ICMP: TidIcmpClient;
// indy-Clients
begin
ICMP:= TidICMPClient.Create(
nil);
result:= '
offline';
ICMP.Host:= Host;
try
ICMP.Ping;
except
result:= '
connected?';
End;
if ICMP.ReplyStatus.ReplyStatusType <> rsTimeOut= true
then result:='
online'
else result:='
offline'
ICMP.Free;
end;