本文整理自网络,侵删。
function Get(URL: string): boolean;
var
IDHTTP: TIDHttp;
ss: String;
begin
Result:= False;
IDHTTP:= TIDHTTP.Create(nil);
try
try
idhttp.HandleRedirects:= true; //必须支持重定向否则可能出错
idhttp.ReadTimeout:= 30000; //超过这个时间则不再访问
ss:= IDHTTP.Get(URL);
if IDHTTP.ResponseCode=200 then
Result :=true;
except
end;
finally
IDHTTP.Free;
end;
end;
相关阅读 >>
Delphi webbrowser设置自己定义user-agent
Delphi使用idtcpclient和idtcpserver相互发送数据
Delphi xe 与plc通讯(intcpserver 二进制)
Delphi中使用goo.gl(google的缩短url服务)api
Delphi 移动windows开始按钮到任务栏中的任何位置
更多相关阅读请进入《Delphi》频道 >>