IE캐시를 모두 지우기
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 > 프로시저-함수' 카테고리의 다른 글
델파이 유용한 함수정리 1탄 (0) | 2021.06.23 |
---|---|
델파이 함수 RoundTo (0) | 2021.06.22 |
델파이 자주사용되는 함수/프로시저 (0) | 2021.06.21 |
델파이 messagedlg 세가지버튼 처리 (0) | 2021.06.21 |
MessageBox 사용법 (0) | 2021.05.20 |
댓글