尝试使用indy下载文件(发布到asp保存excel响应),但遇到错误,使用wireshark请求缺少cookie。从TWebBrowser获取Cookie
尝试从Twebbrowser窗口抓取cookie并保存。
procedure TForm1.WebBrowser1DownloadComplete(Sender: TObject);
var
document: IHTMLDocument2;
cookies:tstringlist;
begin
cookies:=tstringlist.Create;
document := WebBrowser1.Document as IHTMLDocument2;
cookies.Add(document.cookie);
//do stuff with them
end;
回报什么,什么来提取一个cookie(或2)出twebbrowser的,或最好的办法是有更好的东西我失踪?
这里有一个URL,我发现了一些代码,显示如何加载'wininet.dll'并调用它的'InternetGetCookieExA'方法,它检索'HTMLOnly' Cookie。 (http://portal.clevercomponents.com/KB/a74/copy-twebbrowser-cookies-to-tclhttp.aspx) – 2017-01-04 04:46:22