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

Вниз

следим за заголовками   Найти похожие ветки 

 
LexXL   (2006-10-25 08:18) [0]

Есть форма на ней  Webbrowser,необходимо логировать заголовки отправленные и полученные Webbrowser-м, большая просьба помочь.
Заранее огромное спасибо!


 
Dmitrij_K   (2006-10-25 13:47) [1]

Перехватывай функции передачи\приема
http://madshi.net/madCodeHookDescription.htm
вот рабочий пример для send, только он у меня из dll
uses
 Windows,Messages,SysUtils, WinSock,
 madCodeHook;

var
 SendNext1 : function (const s:Integer; Buf:PChar; len, flags: Integer ): Integer; stdcall;
 SendNext2 : function (const s:Integer; Buf:PChar; len, flags: Integer ): Integer; stdcall;

procedure send_(Buf:PChar; len:Integer);
var
 CDS: TCopyDataStruct;
begin
 CDS.dwData := GetCurrentProcessId;
 CDS.cbData := len;
 CDS.lpData := Buf;
 SendMessage(FindWindow("t_hook_send",nil), WM_COPYDATA, 0, Integer(@CDS));
end;

function SendHook1(const s:Integer; Buf:PChar; len, flags: Integer): Integer; stdcall;
begin
 send_(Buf,len);
 Result := SendNext1(s, Buf, len, flags);
end;

function SendHook2(const s:Integer; Buf:PChar; len, flags: Integer): Integer; stdcall;
begin
 send_(Buf,len);
 Result := SendNext2(s, Buf, len, flags);
end;

function IsDo:Boolean;
var
 TheFileName: array[0..MAX_PATH] of char;
 s:string;
begin
 FillChar(TheFileName, sizeof(TheFileName), #0);
 GetModuleFileName(0, TheFileName, sizeof(TheFileName));
 s := LowerCase(ExtractFileName(TheFileName));
 Result := (s="firefox.exe") or (s="iexplore.exe") or (s="project1.exe");
end;

begin
 if IsDo then
 begin
   if HookAPI("wsock_32.dll", "send", @SendHook1, @SendNext1) and HookAPI("wsock32.dll", "send", @SendHook2, @SendNext2) then
     MessageBox(0, "Hook OK", "blablabla",mb_ok)
   else MessageBox(0, "Hook fail", "blablabla",mb_ok)
 end;
end.


 
LexXL   (2006-10-25 14:04) [2]

извеняюсь скорее всего я не так сформулировал вопрос : под заголовками я имел в виду HTTP заголовки вида :

GET http://yandex.ru HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; DigExt)
Host: yandex.ru

HTTP/1.0 200 OK
Date: Sat, 03 Sep 2005 146:15 GMT
Server: Apache/1.3.33 (Unix) mod_jk/1.2.5 PHP/4.3.10 mod_deflate/1.0.21
X-Powered-By: PHP/4.3.10
cookie> readnews=57378%2C57376%2C57369%2C57371%2C57380%2C57377%2C57375%2C57374%2C57373%2C57372%2C57364%2C57363%2C57360%2C57359%2C57358%2C57357%2C57356%2C57355%2C57354%2C57379%2C57297%2C57352%2C57370%2C57368%2C57351%2C57362%2C57367%2C57366%2C57365%2C57361; expires=Sun, 04-Sep-2005 146:15 GMT; path=/
hdr> Set-Cookie: readnews=57378%2C57376%2C57369%2C57371%2C57380%2C57377%2C57375%2C57374%2C57373%2C57372%2C57364%2C57363%2C57360%2C57359%2C57358%2C57357%2C57356%2C57355%2C57354%2C57379%2C57297%2C57352%2C57370%2C57368%2C57351%2C57362%2C57367%2C57366%2C57365%2C57361; expires=Sun, 04-Sep-2005 146:15 GMT; path=/
Content-Type: text/html; charset=latin1

вот как отправлять я знаю но как узнать ответ (желательно у webbrowser) я нигде не могу найти
есть наметки из :

uses MSHTML;
...
(WebBrowser as IHTMLDocument2Disp).cookie;
(WebBrowser as IHTMLDocument2Disp).domain;
(WebBrowser as IHTMLDocument2Disp).protocol;
(WebBrowser as IHTMLDocument2Disp).{...};



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

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

Наверх




Память: 0.47 MB
Время: 0.051 c
2-1161857520
Khabibulin
2006-10-26 14:12
2006.11.12
MailSlot


2-1161946280
dm37
2006-10-27 14:51
2006.11.12
Модальная форма


2-1161749896
LexXL
2006-10-25 08:18
2006.11.12
следим за заголовками


2-1161633221
5Stas5
2006-10-23 23:53
2006.11.12
Как сделать многострочный LISTBOX используя только WIN API


2-1162109258
Pazitron_Brain
2006-10-29 11:07
2006.11.12
Перевод Dec-->Bin и обратно