用DELPHI代码的方式清理cookies,如何实现,比较急,高分送出。分不够,再给加,顶者有分...

用DELPHI代码的方式清理cookies,如何实现,比较急,高分送出。分不够,再给加,顶者有分 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiAPI/html/delphi_20061116105108222.html
用DELPHI代码的方式清理cookies,如何实现,比较急,高分送出。分不够,再给加,顶者有分

原理:  
  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

转载于:https://www.cnblogs.com/delphi2007/archive/2009/02/03/1382854.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值