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 xe 获取wifi 信息

Delphi 利用tidhttp实现文件下载的分块断点续传

Delphi fmx jpg 保存数据库 从数据库读取

Delphi post数据与对应的接收方式

Delphi如何获取系统服务(即service服务程序)列表

Delphi adoquery查询更改用户

Delphi 设置richedit的行间距

Delphi dll 字符串传递例子

Delphi图表控件tchart使用faq

Delphi unigui中cookies使用中文汉字的方法

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



打赏

取消

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

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

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

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

评论

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