Código
Function VerificaServidor(HostName: String): boolean;
var
i, Soma : Integer;
PckEntregue : Array[1..3] of Integer;
begin
with ICMP do
begin
Try
BytesRecebidos := 0;
Host := HostName ;
For i:= 1 to 3 do
begin
Ping;
if BytesRecebidos > 0 Then
PckEntregue[i] := 1
else
PckEntregue[i] := 0
end;
Finally
Soma := 0;
For i:= 1 to 3 do
Soma := Soma + PckEntregue[i];
if Soma >= 2 Then
Result := True
else
Result := False;
end;
end;
end;
Planeta Delphi - www.planetadelphi.com.br - Todos os direitos reservados | Copyright 2001-2009