Показать сообщение отдельно
Старый 04.04.2004, 08:13     # 1
Mind
Junior Member
 
Аватар для Mind
 
Регистрация: 05.02.2004
Адрес: Indianapolis
Сообщения: 64

Mind Путь к славе только начался
Question помогите (URL prof)

vot proga
ona proveraet syzestvovanie URL.
a kak iz nee perevesti polychenoe v kakoi nibyd label1.caption ili echo cho ni byd?
-------------------------------------------------------
uses wininet;

function CheckUrl(url: string): boolean;
var
hSession, hfile, hRequest: hInternet;
dwindex, dwcodelen: dword;
dwcode: array [1..20] of char;
res: pchar;
begin
if pos('http://', lowercase(url)) = 0 then
url := 'http://'+url;
Result := false;
hSession := InternetOpen('InetURL:/1.0', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
if assigned(hsession) then
begin
hfile := InternetOpenUrl(hsession, pchar(url), nil, 0, INTERNET_FLAG_RELOAD, 0);
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);
InternetCloseHandle(hsession);
end;
end;
----------------------------------------------------------
Mind вне форума