全部博文(788)
分类:
2009-02-03 09:56:12
原理:
CMD下:
DEL/Q "C:\Documents and Settings\<用户名>\Cookies
用winexec吧!
顶呀。还有没有更好的法了。。。最好是代码给我,我急用。
顶顶~
1楼已经说了啊
uses
shlobj;
{$R *.dfm}
function GetSpecialFolder(const CSIDL : integer) : string;
var
RecPath : PAnsiChar;
begin
RecPath := StrAlloc(MAX_PATH);
try
FillChar(RecPath^,MAX_PATH,0);
if SHGetSpecialFolderPath(0,RecPath,CSIDL,false) then begin
result := RecPath;
end else result := '';
finally
StrDispose(RecPath);
end;
end;
procedure DelFiles(const Directory: string);
var
DirInfo: TSearchRec;
Finder: Integer;
Dir: string;
begin
Dir := Directory;
Finder := FindFirst(Dir+'\*.*', FaAnyfile, DirInfo);
while Finder = 0 do
begin
DeleteFile(PChar(Dir+'\'+DirInfo.Name));
Finder := FindNext(DirInfo);
end;
FindClose(DirInfo);
end;
procedure TForm1.BtnDelCookiesClick(Sender: TObject);
begin
DelFiles(GetSpecialFolder(CSIDL_COOKIES));
end;
结贴 sanmaotuo(老冯) (100)、
SZ