Hallo,
ich hab folgende Funktion:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24:
| function exists_url(URL: String): Boolean; var Session, thefile: hInternet; index,CodeLength: cardinal; Code: array[1..20] of Char; res: PChar; begin Result := False; Session := InternetOpen('InetURL:/1.0',INTERNET_OPEN_TYPE_PRECONFIG,nil,nil,0); if Assigned(session) then begin thefile := InternetOpenUrl(session, pchar(URL), nil, 0, INTERNET_FLAG_RELOAD,0); Index := 0; CodeLength := 10; HttpQueryInfo(thefile, HTTP_QUERY_STATUS_CODE, @Code, CodeLength, Index); res:= pchar(@Code); if res = '200' then Result := True;
if Assigned(thefile) then InternetCloseHandle(thefile); end; InternetCloseHandle(session); end; |
ich möchte jetzt, dass eine überprüfung nach 10 Sekunden automatisch abgebrochen wird. wie mache ich das?
Grüße,
reg
Moderiert von
raziel: Code- durch Delphi-Tags ersetzt.