Mar
22
Как получить имя файла из кеша ИЕ.
23:08uses 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;