如何获取HttpOnly Cookie
答案:1 悬赏:0
解决时间 2021-01-27 15:49
- 提问者网友:献世佛
- 2021-01-27 03:16
如何获取HttpOnly Cookie
最佳答案
- 二级知识专家网友:野味小生
- 2021-01-27 04:03
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;
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯