使用IdHTTP、Memo控件: uses ShellAPI;var AURL:string; begin AURL:='http://www.baidu.com'; ShellExecute(0,'Open','IExplore.exe',PChar(AURL),'',SW_SHOW); Memo1.Text:=IdHTTP1.Get(AURL) end;
TWebBrowser就行了。至于要获取源码已经有很多人写过类似的东西了。你搜索一下吧。
你们没能明白我的意思 我是想要连接ie 就是点击button1 让IE打开一个页面 XX 然后点击button2 让刚把刚才打开的这个XX页面的源码保存到MEMO1中我并不是想要获取HTML源码,用webbrowser我也可以做(这里的获取源码只是例子).我是想要让程序连接ie 。还请各位高手帮忙
var xWin:TShellWindows; i : integer; ChUrl : string; par : Variant; begin xWin := TShellWindows.Create(nil); for i := 0 to xWin.count - 1 do begin if ((xwin.Item(i) as IWebbrowser2).LocationURL='http://www.baidu.com/') then begin//寻找特定网页 ChUrl := 'www.csu.edu.cn';//让IE浏览特定网页 (xwin.Item(i) as IWebbrowser2).Navigate (ChUrl,EmptyParam,EmptyParam,EmptyParam,EmptyParam); mmo1.Text := (((xWin.Item(i) as IWebbrowser2).Document) as IHTMLDocument2).body.outerHTML;//获取特定网页的源代码 end; end; xwin.Free; end; 自己看一下咯,不知道是不是你要的!
uses ShellAPI;var AURL:string;
begin
AURL:='http://www.baidu.com';
ShellExecute(0,'Open','IExplore.exe',PChar(AURL),'',SW_SHOW);
Memo1.Text:=IdHTTP1.Get(AURL)
end;
我是想要连接ie
就是点击button1 让IE打开一个页面 XX
然后点击button2 让刚把刚才打开的这个XX页面的源码保存到MEMO1中我并不是想要获取HTML源码,用webbrowser我也可以做(这里的获取源码只是例子).我是想要让程序连接ie 。还请各位高手帮忙
xWin:TShellWindows;
i : integer;
ChUrl : string;
par : Variant;
begin
xWin := TShellWindows.Create(nil);
for i := 0 to xWin.count - 1 do
begin
if ((xwin.Item(i) as IWebbrowser2).LocationURL='http://www.baidu.com/') then
begin//寻找特定网页
ChUrl := 'www.csu.edu.cn';//让IE浏览特定网页
(xwin.Item(i) as IWebbrowser2).Navigate
(ChUrl,EmptyParam,EmptyParam,EmptyParam,EmptyParam);
mmo1.Text := (((xWin.Item(i) as IWebbrowser2).Document) as
IHTMLDocument2).body.outerHTML;//获取特定网页的源代码
end;
end;
xwin.Free;
end;
自己看一下咯,不知道是不是你要的!
http://www.microsoft.com/mind/0598/browhelp.asp
http://support.microsoft.com/default.aspx?scid=kb;en-us;160957