S
SexyGG
Unregistered / Unconfirmed
GUEST, unregistred user!
我想写个函数
自动收集webbrowser1的链结,然后添加到TStringlist中
为什么下面的不行???
uses mshtml
procedure TForm1.GetURL(List:Tstringlist);
var
Document : IHtmlDocument2;
Link : IHTMLElement;
StrLinks : string;
i : integer;
begin
List:=Tstringlist.Create ;
List.Clear ;
Document := WebBrowser1.Document as IHTMlDocument2;
for i := 0 to Document.Links.Length - 1 do
begin
Link := Document.Links.Item(i, 0) as IHTMLElement;
StrLinks := Link.ToString ;
List.Add(StrLinks);
end;
end;
自动收集webbrowser1的链结,然后添加到TStringlist中
为什么下面的不行???
uses mshtml
procedure TForm1.GetURL(List:Tstringlist);
var
Document : IHtmlDocument2;
Link : IHTMLElement;
StrLinks : string;
i : integer;
begin
List:=Tstringlist.Create ;
List.Clear ;
Document := WebBrowser1.Document as IHTMlDocument2;
for i := 0 to Document.Links.Length - 1 do
begin
Link := Document.Links.Item(i, 0) as IHTMLElement;
StrLinks := Link.ToString ;
List.Add(StrLinks);
end;
end;