delphi IdHttp 获取链接连通状态


本文整理自网络,侵删。

 
var
  http : TIdHttp;
  url : string;
  code : integer;
begin
  url := 'http://www.delphitop.com/';
  http := TIdHTTP.Create(nil);
  try
    try
      http.Get(url, nil);
      code := http.ResponseCode;
    except
      on E: EIdHTTPProtocolException do
        code := http.ResponseCode; // or: code := E.ErrorCode;
    end;
    ShowMessage(IntToStr(code));
  finally
    http.Free();
  end;

相关阅读 >>

Delphi 判断一目录是否共享

Delphi编写的一款锁屏小工具

Delphi getprocessisadmin()判断exe是否以管理员身份启动

Delphi 获得当前进程所使用的内存

Delphi xe 移动平台 showmodal 范例

Delphi多线程学习:多线程数据库查询(ado)

Delphi - 如何执行windows、osx、linux的外部程序?

Delphi 实现放大效果

Delphi 防局域网控制网速代码

Delphi tlistview按指定列排序

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...

    正在狠努力加载,请稍候...