Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.07.09;
Скачать: CL | DM;

Вниз

Парсинг Url a   Найти похожие ветки 

 
rOOse ©   (2006-03-07 08:31) [0]

Нужно с линка http://www.somesite.com/abc/def/index.html
вытащить http://www.somesite.com это самому парсить надо или есть какие-то методы?


 
Dmitrij_K   (2006-03-07 10:03) [1]

В indy есть класс TidURL или TidURI? уже точно не помню


 
Dmitrij_K   (2006-03-07 10:13) [2]

Удалено модератором


 
Dmitrij_K   (2006-03-07 10:14) [3]

Удалено модератором


 
Dmitrij_K   (2006-03-07 10:30) [4]

Удалено модератором


 
seeker ©   (2006-03-07 10:38) [5]


function InternalInternetCrackUrl(  Url: string;                        // string that contains the canonical URL to crack
                         options:TInternetURLCrackOptions;   // icoDECODE: Converts encoded characters back to their normal form.
                                                             // icoESCAPE Converts all escape sequences (%xx) to their corresponding characters
                         var UrlComponents: TURL_Components  // TURLCOMPONENTS structure that receives the URL components
                         ): boolean;                         // Returns TRUE if the function succeeds, or FALSE otherwise.
var                                                              //   To get extended error information, "call GetLastError"
 dwFlags: DWORD; // that contains the flags controlling the operation. This can be one of the following values: ICU_DECODE (Converts encoded characters back to their normal form.), ICU_ESCAPE (Converts all escape sequences (%xx) to their corresponding characters)
 aUrlComponents: TURLComponents;
begin
 dwFlags:=0;
 if icoDECODE in options then
   dwFlags:=dwFlags or ICU_DECODE;
 if icoESCAPE in options then
   dwFlags:=dwFlags or ICU_ESCAPE;

 aUrlComponents.dwSchemeLength:=1024;
 aUrlComponents.dwHostNameLength:=1024;
 aUrlComponents.dwUserNameLength:=1024;
 aUrlComponents.dwPasswordLength:=1024;
 aUrlComponents.dwUrlPathLength:=1024;
 aUrlComponents.dwExtraInfoLength:=1024;
 aUrlComponents.dwStructSize:=sizeof(aUrlComponents);
 getMem(aUrlComponents.lpszScheme,aUrlComponents.dwSchemeLength);
 getMem(aUrlComponents.lpszHostName,aUrlComponents.dwHostNameLength);
 getMem(aUrlComponents.lpszUserName,aUrlComponents.dwUserNameLength);
 getMem(aUrlComponents.lpszPassword,aUrlComponents.dwPasswordLength);
 getMem(aUrlComponents.lpszUrlPath,aUrlComponents.dwUrlPathLength);
 getMem(aUrlComponents.lpszExtraInfo,aUrlComponents.dwExtraInfoLength);
 try
   result:=boolean(InternetCrackUrl(pchar(Url),0, dwFlags,aUrlComponents));
   if result then
   begin
     UrlComponents.Scheme:=string(aUrlComponents.lpszScheme);
     UrlComponents.nScheme:=APISchemeEnumToNative(aUrlComponents.nScheme);
     UrlComponents.HostName:=string(aUrlComponents.lpszHostName);
     UrlComponents.nPort:=aUrlComponents.nPort;
     UrlComponents.pad:=aUrlComponents.pad;
     UrlComponents.UserName:=string(aUrlComponents.lpszUserName);
     UrlComponents.Password:=string(aUrlComponents.lpszPassword);
     UrlComponents.UrlPath:=string(aUrlComponents.lpszUrlPath);
     UrlComponents.ExtraInfo:=string(aUrlComponents.lpszExtraInfo);
   end;
 finally
   freeMem(aUrlComponents.lpszScheme,aUrlComponents.dwSchemeLength);
   freeMem(aUrlComponents.lpszHostName,aUrlComponents.dwHostNameLength);
   freeMem(aUrlComponents.lpszUserName,aUrlComponents.dwUserNameLength);
   freeMem(aUrlComponents.lpszPassword,aUrlComponents.dwPasswordLength);
   freeMem(aUrlComponents.lpszUrlPath,aUrlComponents.dwUrlPathLength);
   freeMem(aUrlComponents.lpszExtraInfo,aUrlComponents.dwExtraInfoLength);
 end;
end;


 
rOOse ©   (2006-03-07 12:30) [6]


> [5] seeker ©   (07.03.06 10:38)


Спасибо.



Страницы: 1 вся ветка

Текущий архив: 2006.07.09;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.066 c
2-1150388122
PRT
2006-06-15 20:15
2006.07.09
Нужен компонент


2-1148988795
antoxa2005
2006-05-30 15:33
2006.07.09
Стандартная задача, но не получается. Помогите: Очень ЖДУ!!!


2-1150390833
learner
2006-06-15 21:00
2006.07.09
Корректное "не создание" класса


2-1150898583
vacek
2006-06-21 18:03
2006.07.09
С помощью чего можно получить доступ к не списку компонента com


15-1149845185
Некто
2006-06-09 13:26
2006.07.09
Отпуск!