标题:[求助]有什么办法可以让一个本地磁盘上的一个htm文件 不经过CppWebBrowser空 ...
只看楼主
mazheng75
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2004-5-11
 问题点数:0 回复次数:2 
[求助]有什么办法可以让一个本地磁盘上的一个htm文件 不经过CppWebBrowser空间 而让
有什么办法可以让一个本地磁盘上的一个htm文件 不经过CppWebBrowser空间 而让
 IHTMLDocument2 直接读取这个htm文件 3Q!!!!!!!!!!!!!! 急!!!!!!!!!!!!!!!
搜索更多相关主题的帖子: htm文件 磁盘 空间 办法 
2004-06-02 17:01
yangguofa
Rank: 1
等 级:新手上路
帖 子:197
专家分:0
注 册:2004-5-5
得分:0 
procedure TForm1.Button3Click(Sender: TObject);
var
DoC: IHTMLDocument2;
begin
list:=TstringList.Create;
Doc := WebBrowser1.Document as IHTMLDocument2;
Memo1.Lines.Add(Doc.body.outerhtml); //读源码
Memo1.Lines.Add(Doc.body.outerText); //Html To Text
end;

需要引入
component/import activeX control ../microsoft html object library(version4.0).  

再uses里 MSHTML_TLB

试试看吧

/bbs/UploadFile/2005-3/2005320191459674.gif" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www./bbs/UploadFile/2005-3/2005320191459674.gif');}" onmousewheel="return imgzoom(this);" alt="" />
2004-06-08 15:26
mazheng75
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2004-5-11
得分:0 
你这个不是依旧用了CppWebBrowser。我的意思是说不用CppWebBrowser ,而直接将html文件传给IHTMLDocument2; ,从而获取春本本.
2004-06-08 15:40



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-1935-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.923372 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved