查看IE历史记录信息

  • 主题发起人 主题发起人 import
  • 开始时间 开始时间
I

import

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button4Click(Sender: TObject);
var
FirstCacheHandle: THandle;
PFirstCacheEntryInfo,PNextCacheEntryInfo: PInternetCacheEntryInfoA;
FirstCacheEntryInfo,NextCacheEntryInfo: TInternetCacheEntryInfoA;
FirstCacheEntryInfoBufferSize,NextCacheEntryInfoBufferSize: Dword;
HaveItem :Boolean;
begin
HaveItem := True;
FirstCacheEntryInfoBufferSize := 0;
NextCacheEntryInfoBufferSize := 0;
FirstCacheEntryInfo.dwStructSize := FirstCacheEntryInfoBufferSize;
NextCacheEntryInfo.dwStructSize := NextCacheEntryInfoBufferSize;
GetMem(PFirstCacheEntryInfo,sizeof(TInternetCacheEntryInfoA));
GetMem(PNextCacheEntryInfo,sizeof(TInternetCacheEntryInfoA));
//Dispose(PNextCacheEntryInfo);
PFirstCacheEntryInfo^.dwStructSize := sizeof(TInternetCacheEntryInfoA);
PNextCacheEntryInfo^.dwStructSize := sizeof(TInternetCacheEntryInfoA);
FirstCacheHandle := 0;
while FirstCacheHandle=0 do
begin
FirstCacheHandle :=FindFirstUrlCacheEntryEx
('',0,URLCACHE_FIND_DEFAULT_FILTER
,0,PFirstCacheEntryInfo,@FirstCacheEntryInfoBufferSize,nil,nil,nil);
if FirstCacheHandle =0 then
begin
//Freemem(PFirstCacheEntryInfo);
case GetLastError of
ERROR_NO_MORE_ITEMS :
begin
FindCloseUrlCache(FirstCacheHandle);
FreeMem(PFirstCacheEntryInfo);
Break;
end;
ERROR_INSUFFICIENT_BUFFER :
begin
FreeMem(PFirstCacheEntryInfo);
GetMem(PFirstCacheEntryInfo,FirstCacheEntryInfoBufferSize);
PFirstCacheEntryInfo^.dwStructSize := FirstCacheEntryInfoBufferSize;
continue;
end;
else
begin
showmessage('Can not Press Cache!');
Break;
end;
end;
end;
end
try
while HaveItem=true do
begin
if not (FindNextUrlCacheEntryEx(FirstCacheHandle,PNextCacheEntryInfo,
@NextCacheEntryInfoBufferSize,nil,nil,nil)) then
begin
//FreeMem(PNextCacheEntryInfo);
case GetLastError of
ERROR_NO_MORE_ITEMS :
begin
FindCloseUrlCache(FirstCacheHandle);
HaveItem :=false;
continue;
end;
ERROR_INSUFFICIENT_BUFFER :
begin
FreeMem(PNextCacheEntryInfo);
GetMem(PNextCacheEntryInfo,NextCacheEntryInfoBufferSize);
PNextCacheEntryInfo^.dwStructSize := NextCacheEntryInfoBufferSize;
continue;
end;
else
begin
FreeMem(PNextCacheEntryInfo);
showmessage('Error');
Break;
end;
end;
end
else
begin
Listbox1.items.add(strpas(PNextCacheEntryInfo^.lpszSourceUrlName));
Listbox2.items.add(strpas(PNextCacheEntryInfo^.lpszLocalFileName));
end;
end;
except
end;
//freemem(PFirstCacheEntryInfo);
//freemem(PNextCacheEntryInfo);
//Dispose(PFirstCacheEntryInfo);
end;
 

Similar threads

S
回复
0
查看
589
SUNSTONE的Delphi笔记
S
S
回复
0
查看
686
SUNSTONE的Delphi笔记
S
I
回复
0
查看
452
import
I
I
回复
0
查看
577
import
I
I
回复
0
查看
689
import
I
后退
顶部