希望给出源代码,谢谢
解决方案 »
- 【请教】如何用DELPHI开发USB驱动程序?
- 怎么截获DELPHI内部数据库组件的SQL语句?超难
- console application 如何设置其版本信息(Version info)?
- 关于delphi7的问题
- insert into问题
- 关于XPMenu的问题
- 动态数组控件的问题(较复杂)
- 真想哭.............各位ADO高手,为什么把文件刻到光盘里就打不开.MDB.........
- 如何打印DBGrid中某一条或某几条不连续的记录?
- delphi 6 第2碟一大堆控件,乱得很,看了半天,还不明白是些什么东西,有谁先我一步,给我介绍一下到底是什么东西(我E文可不太好)
- 寻找组件:类似TComboBox
- 邮件发送中的身份验证问题
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls, StdCtrls,shellapi,shdocvw,shlObj,wininet,mshtml, ExtCtrls;type
TForm1 = class(TForm)
Panel1: TPanel;
Button4: TButton;
Panel2: TPanel;
ListBox2: TListBox;
ListBox1: TListBox;
Splitter1: TSplitter;
procedure Button4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}const TempInternet: string = 'C:\WINDOWS\Temporary Internet Files\Content.IE5\7BZR3LYA\';
//NT : TempInternet: string = '....';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;end.