zoukankan      html  css  js  c++  java
  • Delphi Ping

    function PingServer(HostIP: string;LinkTimeOut: integer): boolean;
    var
      RRemoteC: TIdIcmpClient;
      AReplyStatus: TReplyStatus;
    begin
      try
        result := true;
        RRemoteC := TIdIcmpClient.Create(nil);
        RRemoteC.Host := HostIP;
        RRemoteC.ReceiveTimeout := LinkTimeOut;
        try
          RRemoteC.Ping;
          AReplyStatus := RRemoteC.ReplyStatus;
          if (AReplyStatus.ReplyStatusType = rsTimeOut) then
          begin
            result := false;
          end;
        except
          result := false;
        end;
      finally
        RRemoteC.Free;
      end;
    end;
    

      

  • 相关阅读:
    Linux文件权限
    Linux命令
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
  • 原文地址:https://www.cnblogs.com/CipherLab/p/12862720.html
Copyright © 2011-2022 走看看