我想做一个软件删除历史记录,cookies这种 ( 积分: 50 )

  • 主题发起人 主题发起人 yaojbo
  • 开始时间 开始时间
Y

yaojbo

Unregistered / Unconfirmed
GUEST, unregistred user!
有没有源代码提供下载
 
有没有源代码提供下载
 
怎么人这么少啊。
 
有代码的说。
去DELPHIBOX。COM上面下载 《DELPHI下核心编程代码》!
 
我已经下载过了。看了之后。
输到电脑上。运行出错的。能不能把能正常运行的代码给我一份,谢谢
 
function GetCookiesFolder:string;
var
pidl:pItemIDList;
buffer:array [ 0..255 ] of char ;
begin
SHGetSpecialFolderLocation(0, CSIDL_COOKIES, pidl);
SHGetPathFromIDList(pidl, buffer);
result:=strpas(buffer);
end;
//
function ShellDeleteFile(sFileName: string): Boolean;
var
FOS: TSHFileOpStruct;
begin
FillChar(FOS, SizeOf(FOS), 0); {记录清零}
with FOS do
begin
wFunc := FO_DELETE;//删除
pFrom := PChar(sFileName);
fFlags := FOF_NOCONFIRMATION;
end;
Result := (SHFileOperation(FOS) = 0);
end;
//
procedure DelCookie;
var
dir:string;
begin
InternetSetOption(nil, INTERNET_OPTION_END_BROWSER_SESSION, nil, 0);
dir:=GetCookiesFolder;
//showmessage(dir);
ShellDeleteFile(dir+'/*.txt');
end;
//

在USER里面加入如下单元;
WinINet,shlobj,shellapi

以上是清除COOKIE的
 
{=================================================================
功 能: 清空回收站
叁 数: 无
返回值: 无
=================================================================}
procedure EmptyRecycleBin;
const
SHERB_NOCONFIRMATION = $00000001;
SHERB_NOPROGRESSUI = $00000002;
SHERB_NOSOUND = $00000004;
type
TSHEmptyRecycleBin = function (Wnd: HWND;LPCTSTR: PChar;DWORD: Word): integer; stdcall;
var
SHEmptyRecycleBin: TSHEmptyRecycleBin;
LibHandle: THandle;
begin
LibHandle := LoadLibrary(PChar('Shell32.dll'));
if LibHandle <> 0 then
@SHEmptyRecycleBin := GetProcAddress(LibHandle, 'SHEmptyRecycleBinA')
else begin
MsgBox('Failed to load Shell32.dll.', mtError, [mbOK]);
Exit;
end;
if @SHEmptyRecycleBin <> nil then
SHEmptyRecycleBin(Application.Handle,'',SHERB_NOCONFIRMATION or SHERB_NOPROGRESSUI or SHERB_NOSOUND);
FreeLibrary(LibHandle);
@SHEmptyRecycleBin := nil;
end;
 
接受答案了.
 

Similar threads

回复
0
查看
1K
不得闲
D
回复
0
查看
943
DelphiTeacher的专栏
D
D
回复
0
查看
882
DelphiTeacher的专栏
D
D
回复
0
查看
878
DelphiTeacher的专栏
D
后退
顶部