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;

猜你喜欢

转载自www.cnblogs.com/windson/p/12505361.html