Главная страница
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.043 c
1-1148748141
Ярослав
2006-05-27 20:42
2006.07.09
Вызов MDI из DLL


15-1149823126
Tirael
2006-06-09 07:18
2006.07.09
индикатор флешки


2-1150841634
!_SM_!
2006-06-21 02:13
2006.07.09
TChart


2-1150989372
Urvin
2006-06-22 19:16
2006.07.09
List View - не добавляются элементы


1-1148908777
AFfonya
2006-05-29 17:19
2006.07.09
CMD.EXE выполение произвольной команды