![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Как по HTTP проверить наличие/доступность файла в инете? [D5]
lipskiy © (2002-06-21 01:35:00)Собственноручно выложенная в UBPFD функция
http://delphibase.endimus.com/?action=viewfunc&topic=netconnect&index=2
работает не всегда правильно, на отсутствующие файла говорит ок.
Есть надежный вариант проверить?
Cobalt (2002-06-22 16:20:00) [1]http://msdn.microsoft.com/workshop/networking/wininet/reference/functions/internetopenurl.asp
Return Value
Returns a valid handle to the FTP, Gopher, or HTTP URL if the connection is successfully established, or NULL if the connection fails. To retrieve a specific error message, call GetLastError. To determine why access to the service was denied, call InternetGetLastResponseInfo.
lipskiy (2002-06-22 15:01:00) [2]А как ее проверить?
Cobalt (2002-06-22 11:01:00) [3]hfile:=InternetOpenUrl(hsession,pchar(URL),nil,0,INTERNET_FLAG_RELOAD,0); А где проверка коректности hfile? может здесь собака порылась?
dwIndex:= 0;
dwCodeLen:= 10;
HttpQueryInfo(hfile,HTTP_QUERY_STATUS_CODE,@dwcode,dwcodeLen,dwIndex);
res:= pchar(@dwcode);
result:= (res ="200") or (res ="302");
if assigned(hfile) then InternetCloseHandle(hfile);
lipskiy (2002-06-21 19:49:00) [4]Ну ась?