Code By GeNiUS !
genius_user@yahoo.com
{Description
Purges files from the internet cache}
{Delphi Code}
Procedure PurgeInternetCache(
MainForm : TForm;
WinDir : String;
IntTempDir : String);
Var
CacheNum : Integer;
c,i : Integer;
CurCache : String;
FileString : String;
FileList : TFileListBox;
StringList : TStringList;
CacheDir : String;
Begin
FileList := TFileListBox.Create(nil);
FileList.Height := 1;
FileList.Width := 1;
FileList.Parent := MainForm;
StringList := TStringList.Create();
Try
CacheNum := 4;
For c := 1 To CacheNum Do
Begin
CurCache := 'Cache'+ IntToStr(c);
CacheDir := WinDir+'\'+IntTempDir+'\'+CurCache;
FileList.Directory := CacheDir;
FileList.Mask := '*.*';
StringList.Clear;
StringList.Assign(FileList.Items);
For i := 0 To StringList.Count - 1 Do
Begin
FileString := CacheDir+'\'+StringList[i];
SetFileAttributes(
PChar(FileString),
FILE_ATTRIBUTE_NORMAL);
DeleteFile(PChar(FileString));
End;
End;
Finally
FileList.Free;
StringList.Free;
End;
End;