uese<br> WinInet;<br><br>procedure DeleteIECache; //清理IE缓存<br>var<br> lpEntryInfo: PInternetCacheEntryInfo;<br> hCacheDir: LongWord;<br> dwEntrySize: LongWord;<br> cachefile: string;<br> i: integer;<br> cancheqqlist: TStringList;<br>begin<br> cancheqqlist := TStringList.Create;<br> cancheqqlist.Clear;<br> dwEntrySize := 0;<br> FindFirstUrlCacheEntry(nil, TInternetCacheEntryInfo(nil^), dwEntrySize);<br> GetMem(lpEntryInfo, dwEntrySize);<br> if dwEntrySize > 0 then<br> lpEntryInfo^.dwStructSize := dwEntrySize;<br> hCacheDir := FindFirstUrlCacheEntry(nil, lpEntryInfo^, dwEntrySize);<br> if hCacheDir <> 0 then<br> begin<br> repeat<br> if (lpEntryInfo^.CacheEntryType) and (NORMAL_CACHE_ENTRY) = NORMAL_CACHE_ENTRY then<br> cachefile := pchar(lpEntryInfo^.lpszSourceUrlName);<br> cancheqqlist.Add(cachefile);<br> for i := 0 to cancheqqlist.Count - 1 do<br> DeleteUrlCacheEntry(pchar(cancheqqlist.Strings)); //'执行删除<br> FreeMem(lpEntryInfo, dwEntrySize);<br> dwEntrySize := 0;<br> FindNextUrlCacheEntry(hCacheDir, TInternetCacheEntryInfo(nil^), dwEntrySize);<br> GetMem(lpEntryInfo, dwEntrySize);<br> if dwEntrySize > 0 then<br> lpEntryInfo^.dwStructSize := dwEntrySize;<br> until not FindNextUrlCacheEntry(hCacheDir, lpEntryInfo^, dwEntrySize);<br> end;<br> FreeMem(lpEntryInfo, dwEntrySize);<br> FindCloseUrlCache(hCacheDir);<br> cancheqqlist.Free;<br>end;