Top.Mail.Ru
Мастера DELPHI, Delphi programming community Титульная страница Поиск, карта сайта Написать письмо 
| Новости | Поиск | FAQ | Статьи | Книги | Новости VCL |
| Форумы ЧАТ | Орешник | KOL и MCK |
Форумы -» Основная («Начинающим»)/ Базы / WinAPI / Компоненты / Сети / Media / Игры / Corba и COM / KOL / FreePascal / .Net / Прочее / RSDN.ORG

« предыдущая ветвь | форум | следующая ветвь »

Рабочий URL [D5, Win95/98, WinXP]


BorisMor ©   (2002-08-03 12:05:00) 

Полскажите как определить что по определенному ардресу [ напрмер http://delphi.mastak.ru:) ] существует сайт.


Opuhshii   (2002-08-05 10:14:00) [1]

2BorisMor (03.08.02 16:58)
Uses WinInet
смотри пост Anatoly Podgoretsky © (03.08.02 20:16)


Anatoly Podgoretsky   (2002-08-04 12:58:00) [2]

Именно это я и говорю


Malder   (2002-08-04 11:13:00) [3]

Anatoly Podgoretsky © (03.08.02 20:16) не понял вашей мысли. Какие порты могут быть любыми ? На которых висит httpd ? Это ясно. Но по другому то не проверишь. Естесственно, что если компьютер тебе не отвечает - это не значит, что он не отвечает никому...


Anatoly Podgoretsky   (2002-08-03 20:16:00) [4]

Не одназначно, порты могут быть любые, и отвечать тебе не обязаны


Malder   (2002-08-03 20:10:00) [5]

Кстати. А что имел в виду автор сообщения ?

Полскажите как определить что по определенному ардресу [ напрмер http://delphi.mastak.ru:) ] существует сайт.

Если именно сайт, то тогда нужно проверять соединение по 80, 8080 портам. А если нужно узнать, существует ли такой хост - это другой вопрос. А если нужно узнать, есть ли компьютер в интернете а данным IP - то это уже третий вопрос...


Jeer   (2002-08-03 17:20:00) [6]

Так тоже можно:
Компонент TNMHTTP с палитры FastNet

Метод nm.Get("delphi.mastak.ru");

OnConnectionFailed или OnConnect обрабатываешь..


BorisMor   (2002-08-03 16:58:00) [7]

>Opuhshii
для InternetOpenUrl нужен InternetOpen и InternetCloseHandle
что подкулючать чтобы Delphi их знала ?

hInternet - это что за тип данных такой странный ?


Opuhshii   (2002-08-03 16:15:00) [8]

есть, в МСДН такая функция описана а вот в WindowsSDK её нет,...

HINTERNET InternetOpenUrl( HINTERNET hInternet,
LPCTSTR lpszUrl,
LPCTSTR lpszHeaders,
DWORD dwHeadersLength,
DWORD dwFlags,
DWORD_PTR dwContext
);


hInternet
[in] HINTERNET handle to the current Internet session. The handle must have been returned by a previous call to InternetOpen.
lpszUrl
[in] Pointer to a string variable that contains the URL to begin reading. Only URLs beginning with ftp:, gopher:, http:, or https: are supported.
lpszHeaders
[in] Pointer to a string variable that contains the headers to be sent to the HTTP server. (For more information, see the description of the lpszHeaders parameter in the HttpSendRequestfunction.)
dwHeadersLength
[in] Unsigned long integer value that contains the length, in TCHARs, of the additional headers. If this parameter is -1L and lpszHeaders is not NULL, lpszHeaders is assumed to be zero-terminated (ASCIIZ) and the length is calculated.
dwFlags
[in] Unsigned long integer value that contains the API flags. This can be one of the following values:
INTERNET_FLAG_EXISTING_CONNECT
Attempts to use an existing InternetConnect object if one exists with the same attributes required to make the request. This is useful only with FTP operations, since FTP is the only protocol that typically performs multiple operations during the same session. The Microsoft® Win32® Internet API caches a single connection handle for each HINTERNET handle generated by InternetOpen.
INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP
Disables the ability of the Win32 Internet functions to detect this special type of redirect. When this flag is used, Win32 Internet functions transparently allow redirects from HTTPS to HTTP URLs.
INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS
Disables the ability of the Win32 Internet functions to detect this special type of redirect. When this flag is used, Win32 Internet functions transparently allow redirects from HTTP to HTTPS URLs.
INTERNET_FLAG_KEEP_CONNECTION
Uses keep-alive semantics, if available, for the connection. This flag is required for Microsoft Network (MSN), NT LAN Manager (NTLM), and other types of authentication.
INTERNET_FLAG_NEED_FILE
Causes a temporary file to be created if the file cannot be cached.
INTERNET_FLAG_RELOAD
Forces a download of the requested file, object, or directory listing from the origin server, not from the cache.
dwContext
[in] Pointer to an unsigned long integer value that contains the application-defined value that is passed, along with the returned handle, to any callback functions.
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.
BEST REGARDS
Opuhshii


Anatoly Podgoretsky   (2002-08-03 14:17:00) [9]

Ясно значит не физическое существование, а наличие записи в DNS
Второй вариант может означать как существование, только не совсем то что ты ожидал увидеть, но и переадресацию также.


BorisMor   (2002-08-03 13:40:00) [10]

Не существует это когда "Cannot find address of".
Ну и "подозрение на не существование" когда открывается сайт с другим URL (это может быть переадресацией)


Anatoly Podgoretsky   (2002-08-03 12:28:00) [11]

В общем случае никак, в частном случае попытаться пропинговать, прочитать что нибудь от туда, просканировать по всему диапазону портов.
Потом существует это что, очень неодназное понятие, попробуй подругому сформулировать вопрос.


BorisMor   (2002-08-03 12:07:00) [12]

извиняюсь за очепятки :)


Наверх

Титульная страница Поиск, карта сайта Написать письмо