Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetUrl(const url: string): Boolean;
- var
- HTTP: TIdHTTP;
- begin
- Result := False;
- HTTP:=TIdHTTP.create;
- HTTP.ConnectTimeout:=60000;
- HTTP.ReadTimeOut:=60000;
- HTTP.HandleRedirects:=false;
- try
- HTTP.Get(url);
- if HTTP.ResponseCode = 200 then
- Result := True;
- except
- Result := False;
- end;
- FreeAndNil(HTTP);
- end;
- //применение
- while not GetUrl('http://www.***************.com') do begin
- LabelB2.Caption:='Сервер не доступен!';
- Application.ProcessMessages;
- Sleep(50);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement