GetEntryContent
Instead of loading
IECache.EntryInfo.LocalFileName you can use GetEntryContent
if you need the content of the cached url. This
function places the content of the entry in
IECache.Content:
TContent = record
Buffer: Pointer;
BufferLength: Integer;
end;
Remember that you are responsible for
freeing the buffer after use:
procedure
TForm1.ListBox1Click(Sender: TObject);
begin
Memo1.lines.Clear;
if pos('.htm',
Listbox1.Items[Listbox1.Itemindex]) > 0
then begin
IECache1.GetEntryContent(Listbox1.Items[Listbox1.Itemindex]);
Memo1.Lines.Add(Pchar(IECache1.Content.buffer));
Freemem(IECache1.Content.buffer,IECache1.Content.BufferLength);
end;
end;
|
This code shows the source of *.htm-files
in a memo, when the user navigates in the listbox.