本文整理自网络,侵删。
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如何获取系统服务(即service服务程序)列表
Delphi unigui中cookies使用中文汉字的方法
更多相关阅读请进入《Delphi》频道 >>