DELPHI detection server address is valid

 
 
DELPH use of ICMP control detects server address

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;

 

Guess you like

Origin www.cnblogs.com/windson/p/12505361.html
Recommended