本文整理自网络,侵删。
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 利用unigui中的tunipagecontrol实现多页面
Delphi firedac 下的 sqlite [2] - 第一个例子
更多相关阅读请进入《Delphi》频道 >>