用DELPHI代码的方式清理cookies,如何实现,比较急,高分送出。分不够,再给加,顶者有分
解决方案 »
- 怎么从繁多的文件中判断哪个文件名是像####-##-##如2012-03-03这样的格式?
- 在哪里可以下载到delphi2007企业版的最新Update ??谢谢
- idtcpserver如何给指定的CLIENT发送数据。CLIENT如何接收
- ADOConnection异常处理
- 这个原因也会导致,"无法更新定位行.一些值在最后读取的时候已更改.",不知道大家知道么?? 怎么解决,大家出个点子.
- *.ini中如何删除的问题。
- stackoverflow问题
- 我的nt服务程序为什么不执行?
- 如何用delphi或者其它开发语言在word中建宏命令?
- for i:=0 to 9 是递增1循环,如何递增2呢?如何递减呢?
- 求助:第一次来这里,请教几个问题,大家帮帮忙!
- delpji中有没有什么变量,它的值能动态的被保存
CMD下:
DEL/Q "C:\Documents and Settings\<用户名>\Cookies用winexec吧!
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)、