delphi 删除Internet临时文件


本文整理自网络,侵删。

 Category: Internet/Lan
Title: Delete the 'Temporary Internet Files'
Author: www.swissdelphicenter.ch
Date added: 15.03.2006
Hits: 1214

uses
WinInet;


procedure DeleteIECache;
var
lpEntryInfo: PInternetCacheEntryInfo;
hCacheDir: LongWord;
dwEntrySize: LongWord;
begin
dwEntrySize := 0;
FindFirstUrlCacheEntry(nil, TInternetCacheEntryInfo(nil^), dwEntrySize);
GetMem(lpEntryInfo, dwEntrySize);
if dwEntrySize > 0 then lpEntryInfo^.dwStructSize := dwEntrySize;
hCacheDir := FindFirstUrlCacheEntry(nil, lpEntryInfo^, dwEntrySize);
if hCacheDir <> 0 then
begin
repeat
DeleteUrlCacheEntry(lpEntryInfo^.lpszSourceUrlName);
FreeMem(lpEntryInfo, dwEntrySize);
dwEntrySize := 0;
FindNextUrlCacheEntry(hCacheDir, TInternetCacheEntryInfo(nil^), dwEntrySize);
GetMem(lpEntryInfo, dwEntrySize);
if dwEntrySize > 0 then lpEntryInfo^.dwStructSize := dwEntrySize;
until not FindNextUrlCacheEntry(hCacheDir, lpEntryInfo^, dwEntrySize);
end;
FreeMem(lpEntryInfo, dwEntrySize);
FindCloseUrlCache(hCacheDir);
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
DeleteIECache;
end;

相关阅读 >>

Delphi中文件名函数-路径、名称、子目录、驱动器、扩展名

Delphi 取得任意程序的命令行

Delphi判断驱动器类型

Delphi 从字符串中提取单词的函数

Delphi 网卡工作状态检测

Delphi xe中windows7新的taskbar功能的使用

Delphi 查找某函数在某个单元

Delphi工具之winsight

Delphi tnethttpclient https忽略证书验证

[Delphi]钩子(hook)机制的使用

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...