Delphi Base

WindSon

导航

DELPHI 检测服务器地址是否有效


利用DELPH 的ICMP控件检测服务器地址

function CheckNetServer():Boolean; begin IdIcmpClient1.Host := '192.168.1.230'; //服务器地址 IdIcmpClient1.Ping; if IdIcmpClient1.ReplyStatus.BytesReceived <= 0 then result:=False else begin result:=True; exit; end; IdIcmpClient1.free
end;

 

posted on 2020-03-16 17:43  windsonvip  阅读(279)  评论(0编辑  收藏  举报