admin管理员组文章数量:1516870
引用WinINet单元
procedureTForm1.DeleteIECache;//清理IE缓存
var
lpEntryInfo:PInternetCacheEntryInfo;
hCacheDir:LongWord;
dwEntrySize:LongWord;
cachefile:string;
i:integer;
cancheqqlist:TStringList;
begin
cancheqqlist:=TStringList.Create;
cancheqqlist.Clear;
dwEntrySize:=0;
FindFirstUrlCacheEntry(nil,TInternetCacheEntryInfo(nil^),dwEntrySize);
GetMem(lpEntryInfo,dwEntrySize);
ifdwEntrySize>0then
lpEntryInfo^.dwStructSize:=dwEntrySize;
hCacheDir:=FindFirstUrlCacheEntry(nil,lpEntryInfo^,dwEntrySize);
ifhCacheDir<>0then
begin
repeat
if(lpEntryInfo^.CacheEntryType)and(NORMAL_CACHE_ENTRY)=NORMAL_CACHE_ENTRYthen
cachefile:=pchar(lpEntryInfo^.lpszSourceUrlName);
cancheqqlist.Add(cachefile);
fori:=0tocancheqqlist.Count-1do
DeleteUrlCacheEntry(pchar(cancheqqlist.Strings[i]));//执行删除
FreeMem(lpEntryInfo,dwEntrySize);
dwEntrySize:=0;
FindNextUrlCacheEntry(hCacheDir,TInternetCacheEntryInfo(nil^),dwEntrySize);
GetMem(lpEntryInfo,dwEntrySize);
ifdwEntrySize>0then
lpEntryInfo^.dwStructSize:=dwEntrySize;
untilnotFindNextUrlCacheEntry(hCacheDir,lpEntryInfo^,dwEntrySize);
end;
FreeMem(lpEntryInfo,dwEntrySize);
FindCloseUrlCache(hCacheDir);
cancheqqlist.Free;
end;
版权声明:本文标题:释放你的硬盘空间:Delphi技巧教你怎么清除inetcache! 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.betaflare.com/biancheng/1770670928a3257230.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论