this slowpoke moves

Delete Cookies from Cache

WinInet

procedure TForm1.Button1Click(Sender: TObject);
var 
  icei     : PINTERNETCACHEENTRYINFO;
  dwSize   : DWord;
  hSearch  : DWord; 

begin
  ListBox1.Items.BeginUpdate;
  ListBox1.Items.Clear;
  dwSize  := 65536; 
  icei    := AllocMem(dwSize); 
  try
    hSearch := FindFirstURLCacheEntry('besucht :',icei^,dwSize);
    if hSearch = 0 then 
    begin 
      ShowMessage(SysErrorMessage(GetLastError)+' '+IntToStr(dwSize)); 
      exit; 
    end; 
    while hSearch <> 0 do 
    begin 
      Application.ProcessMessages; 
      ListBox1.Items.Add(icei^.lpszSourceUrlName);
      dwSize := 65536; 
      if not FindNextURLCacheEntry(hSearch,icei^,dwSize) then 
      begin
        hSearch := 0;
      end; 
    end; 
  finally 
    FreeMem(icei,65536);
    ListBox1.Items.EndUpdate;
  end; 
end; 
Beispiel :
procedure TForm1.Button1Click(Sender: TObject);
var 
  i : integer; 
begin 
  for i := 0 to ListBox1.Items.Count-1 do
  begin 
    //if ListBox1.Checked[i] then  // FÜR EINZELNE COOKIE EINTRÄGE
    begin
      DeleteURLCacheEntry(PChar(ListBox1.Items[i]));
    end; 
  end;
end;

Keine Kommentare:

Kommentar veröffentlichen

Beliebte Posts

Translate