可以了,我的代码如下:
var
Document: IHtmlDocument2;
Link: IHTMLElement;
href: IHTMLElement;
StrLinks, StrHref: string;
i: integer;
begin
Document := WebBrowser1.Document as IHTMlDocument2;
urlLink.Clear;
for i := 0 to Document.Links.Length - 1 do
begin
Link := Document.Links.Item(i, 0) as IHTMLElement;
href := Document.anchors.item(i, 0) as IHTMLElement;
StrLinks := Link.ToString;
StrHref := link.innerText;
if LowerCase(copy(StrLinks,0,4))='file' then Continue;
if LowerCase(copy(StrLinks,0,4))='mail' then Continue;
urlLink.AddEx(StrLinks + '::' + StrHref, true, true);
ProgressBar1.Position:=(ProgressBar1.Width*i) div Document.Links.Length;
end;
end;
给分了