type
TForm1 = class(TForm)
Button1: TButton;
ListBox1: TListBox;
ListBox2: TListBox;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
function FindNextEntrys(Handle:Integer):Boolean;
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
function TForm1.FindNextEntrys(Handle:Integer):Boolean;
var
T: PInternetCacheEntryInfo;
D: DWORD;
begin
D := 0;
FindnextUrlCacheEntryEx(Handle, nil, @D, nil, nil, nil);
GetMem(T, D);
try
if FindNextUrlCacheEntryEx(Handle, T, @D, nil, nil, nil) then begin
ListBox1.Items.Add(T.lpszSourceUrlName);
ListBox2.Items.Add(T.lpszLocalFileName);
Result := True;
end
else
Result := False;
finally
FreeMem(T, D)
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
H:Integer;
T: PInternetCacheEntryInfo;
D: DWORD;
begin
D := 0;
FindFirstUrlCacheEntryEx(nil, 0, NORMAL_CACHE_ENTRY, 0,nil,@D, nil, nil, nil);
GetMem(T, D);
try
H := FindFirstUrlCacheEntryEx(nil,0, NORMAL_CACHE_ENTRY, 0, T, @D, nil, nil, nil);
if (H = 0) then
else begin
repeat
until not FindNextEntrys(H);
FindCloseUrlCache(H);
end
finally
FreeMem(T, D)
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
http://www.csdn.net/develop/String;
begin
If ListBox1.ItemIndex >=0 then begin
http://www.csdn.net/develop/=ListBox1.Items.Strings[ListBox1.ItemIndex];
Self.Caption := URL;
if DeleteUrlCacheEntry(PChar(URL))then
ListBox1.Items.Delete(ListBox1.ItemIndex);
end;
end;
var
html_doc: IHTMLDocument2;
doc_all: IHtmlElementCollection;
vI : IHtmlImgElement;
begin
html_doc := WebBrowser1.Document as IHTMLDocument2;
doc_all := html_doc.images;
for I := 0 to doc_all.length - 1 do
begin
vI := doc_all.item(I, EMPTYPARAM) as IHtmlImgElement;
//访问vI的属性()