19 de out. de 2012

como obter o nome do arquivo de cache do ie (delphi)

uses WinInet;

function GetCacheFileName(const Url: string; var FileName: string): Boolean;
var
  Info: PInternetCacheEntryInfo;
  InfoBufSize: Cardinal;
begin
  Result := False;
  InfoBufSize := 0;
  GetUrlCacheEntryInfo(PChar(Url),
    TInternetCacheEntryInfo(nil^), InfoBufSize);
  if GetLastError = ERROR_INSUFFICIENT_BUFFER then begin
    GetMem(Info, InfoBufSize);
    try
      Result := GetUrlCacheEntryInfo(PChar(Url),
        TInternetCacheEntryInfo(Info^), InfoBufSize);
      if Result then  

      begin
        FileName := Info^.lpszLocalFileName;
      end;
    finally
      FreeMem(Info);
    end;
  end;
end ;

Nenhum comentário:

Postar um comentário