使用 TWebBrowser
uses ........mshtml;
procedure TForm1.Button3Click(Sender: TObject);
var
doc:IHTMLDocument2;
begin
doc:=IHTMLDocument2(webbrowser1.document);
showmessage(doc.body.outerhtml);
end;
procedure TForm1.Button4Click(Sender: TObject);
var
doc:IHTMLDocument2;
begin
doc:=IHTMLDocument2(webbrowser1.document);
doc.location.replace('view-source:'+doc.location.href)
end;
参考下贴:
http://www.delphibbs.com/delphibbs/dispq.asp?lid=1412942