delphi 获取webbrowser的cookies给Idhttp用
来源:互联网 发布:plc电路图绘制软件 编辑:程序博客网 时间:2024/06/05 04:44
网上方法一:(可获取,但不完全)
引用mshtml;
IHTMLDocument(wb1.Document).cooke;
网上方法二:(获取不到!)
引用winnet,使用InternetGetCookieEx
function GetCookie(url: string): string;
const
INTERNET_COOKIE_HTTPONLY = $00002000;
INTERNET_COOKIE_THIRD_PARTY = $00000010;
INTERNET_FLAG_RESTRICTED_ZONE= $00020000;
var
hModule:THandle;
InternetGetCookieEx:function(lpszUrl, lpszCookieName,lpszCookieData: PChar; var lpdwSize: DWORD;dwFlags:DWORD;lpReserved: Pointer): BOOL;StdCall;
CookieSize:DWORD;
cookiedata:PWideChar;
thebool:bool;
begin
result := '';
hModule:=GetModuleHandle('wininet.dll');
if hModule<>0 then
begin
@InternetGetCookieEx:=GetProcAddress(hModule,'InternetGetCookieExW');
if @InternetGetCookieEx<>nil then
begin
CookieSize:=10240;
Cookiedata := AllocMem(CookieSize);
thebool:=InternetGetCookieEx(PWideChar(url),nil,CookieData,CookieSize,INTERNET_COOKIE_HTTPONLY,nil);
if thebool then result := CookieData;
FreeMem(Cookiedata);
end;
FreeLibrary(hModule);
end;
end;
方法三:
引用winnet,直接调用InternetGetCookie
function GetWBCookies(URL: string): string;
var
data : array[0..10240] of Byte;
datalen : cardinal;
begin
Result := '';
datalen := sizeof(data);
if InternetGetCookie(PChar(URL), nil, @data,datalen) then
Result := PChar(@data);
end;
- delphi 获取webbrowser的cookies给Idhttp用
- delphi 怎么将webbrowser的cookie给idhttp用
- delphi 将webbrowser的cookie给idhttp用
- Delphi 用idhttp 获取网页源码
- Delphi IDhttp 获取Cookie
- Delphi IDhttp 获取Cookie
- Delphi IDhttp 获取Cookie
- webbrowser - cookies的获取与提交
- c# webbrowser获取cookies
- idhttp webbrowser
- VB 利用 webbrowser 获取cookies
- delphi获取webbrowser中的元素的值
- delphi IDHttp的基本用法
- Delphi Idhttp的post方法
- Delphi中idHttp获取网页源文件
- Delphi使用IdHttp 获取 HttpsURL内容
- 使用 idHTTP 获取 UTF-8 编码的中文网页 - 回复同学 "Delphi学习者" 的问题
- Idhttp Cookies管理
- 解决编译中“file too short”问题
- JPA入门实例
- 百度定位图
- ASP.NET MVC 5
- Hibernate的用法基于xml方式
- delphi 获取webbrowser的cookies给Idhttp用
- C# MySql DevExpress开发遇到的编码问题
- 使用JavaScript设置闹钟
- SSM项目关于如何下载图片
- Maven简介和环境变量配置和集成Eclipse
- Imageloader 缓存
- Atom打开一个工程文件不可编辑问题处理
- php瀑布流输出时文字始终在浏览器最底部显示;
- YII contoller控制器之间跳转的方法redirect