如何获取httponly cookie
1个回答
展开全部
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);private{ Private declarations }public{ Public declarations }end;varForm1: TForm1;implementation{$R *.dfm}uses unitFunc;function GetIECookiePath():string;varUserProfile :string;
Key ,Name ,CookiePath ,CachePath :string;beginUserProfile := GetEnvironmentVariable('USERPROFILE'); //获取环境变量 //...1、Cookies 文件夹路径
Key := 'Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders';
Name := 'Cookies';
CookiePath := regRead(HKEY_CURRENT_USER ,Key ,Name);
CookiePath := StringReplace(CookiePath,'%USERPROFILE%',UserProfile,[rfReplaceAll]); //...2、Cache 文件夹路径
Key := 'Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders';
Name := 'Cache';
CachePath := regRead(HKEY_CURRENT_USER ,Key ,Name);
CachePath := StringReplace(CachePath,'%USERPROFILE%',UserProfile,[rfReplaceAll]); Result := CookiePath;
end;procedure TForm1.Button1Click(Sender: TObject);varCookiePath :string;
fs :TFileStream;
ms :TMemoryStream;
ss :TStringStream;beginCookiePath := GetIECookiePath + '\index.dat'; fs := TFileStream.Create(CookiePath,fmShareDenyNone);
ms := TMemoryStream.Create;
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);private{ Private declarations }public{ Public declarations }end;varForm1: TForm1;implementation{$R *.dfm}uses unitFunc;function GetIECookiePath():string;varUserProfile :string;
Key ,Name ,CookiePath ,CachePath :string;beginUserProfile := GetEnvironmentVariable('USERPROFILE'); //获取环境变量 //...1、Cookies 文件夹路径
Key := 'Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders';
Name := 'Cookies';
CookiePath := regRead(HKEY_CURRENT_USER ,Key ,Name);
CookiePath := StringReplace(CookiePath,'%USERPROFILE%',UserProfile,[rfReplaceAll]); //...2、Cache 文件夹路径
Key := 'Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders';
Name := 'Cache';
CachePath := regRead(HKEY_CURRENT_USER ,Key ,Name);
CachePath := StringReplace(CachePath,'%USERPROFILE%',UserProfile,[rfReplaceAll]); Result := CookiePath;
end;procedure TForm1.Button1Click(Sender: TObject);varCookiePath :string;
fs :TFileStream;
ms :TMemoryStream;
ss :TStringStream;beginCookiePath := GetIECookiePath + '\index.dat'; fs := TFileStream.Create(CookiePath,fmShareDenyNone);
ms := TMemoryStream.Create;
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询