清空IE缓存-也就是清除掉IE临时文件夹

    技术2026-09-01  2

    引用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; 

    最新回复(0)