利用DELPH 的ICMP控件检测服务器地址
function CheckNetServer():Boolean;
begin
IdIcmpClient1.Host := '192.168.168.168'; //服务器地址
IdIcmpClient1.Ping;
if IdIcmpClient1.ReplyStatus.BytesReceived <= 0 then
result:=False
else
begin
result:=True;
exit;
end;
IdIcmpClient1.free
end;
function CheckNetServer():Boolean;
begin
IdIcmpClient1.Host := '192.168.168.168'; //服务器地址
IdIcmpClient1.Ping;
if IdIcmpClient1.ReplyStatus.BytesReceived <= 0 then
result:=False
else
begin
result:=True;
exit;
end;
IdIcmpClient1.free
end;