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 firedac 获取 insert 记录的自增 id

Delphi tanimate组件

Delphi 扫二维码并识别

Delphi rest服务器返回图像并显示在浏览器中

Delphi 获取窗口矩形的四种方法: getclientrect、clientrect、getwindowrect、boundsrect

Delphi获取网卡mac地址多个方法

Delphi edit右键系统菜单加自定义菜单项

Delphi 串口查询所有com口

Delphi image 等比例缩小

Delphi xe6 android 界面皮肤美化 用stylebook

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



打赏

取消

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

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

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

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

评论

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