一下代码在2000下运行通过,但是到XP下出“拒绝访问”的错误
var
i,j:integer;
begin
OutMemo.Clear;
i:=WEB.oleobject.document.documentelement.document.frames.length;
OutMemo.Lines.Add('have Frames: '+inttostr(i));
for j:=0 to i-1 do
begin
OutMemo.lines.add('');
OutMemo.Lines.Add('Frame '+inttostr(j+1)+' from here');
OutMemo.Lines.Add(WEB.oleobject.document.
documentelement.document.frames.item(j).document.
documentelement.innerHtml);//取得每个Frame中的HTML内容
end;
end;WEB访问的页面的HTML内容为:
<HTML>
<body>
aaaaaaaaaaaaaa
<iframe Src="http://localhost/" width=300 height=200 Name="Page1"></iframe>
<iframe Src="about:blank" width=300 height=200 Name="Page2"></iframe>
</body>
</html>跟踪了一下,如果WEB.oleobject.document.documentelement.document.frames.item(j).document就这一项出错。
但是能够访问Page2也就是Frames.items(1)的内容如果把HTML换成两个iframe的src都换成about:blank,程序就不会有问题。开发环境:Delphi 7 , XP SP2
在2000下运行没问题,真是郁闷。XP SP1运行同样要出错。
var
i,j:integer;
begin
OutMemo.Clear;
i:=WEB.oleobject.document.documentelement.document.frames.length;
OutMemo.Lines.Add('have Frames: '+inttostr(i));
for j:=0 to i-1 do
begin
OutMemo.lines.add('');
OutMemo.Lines.Add('Frame '+inttostr(j+1)+' from here');
OutMemo.Lines.Add(WEB.oleobject.document.
documentelement.document.frames.item(j).document.
documentelement.innerHtml);//取得每个Frame中的HTML内容
end;
end;WEB访问的页面的HTML内容为:
<HTML>
<body>
aaaaaaaaaaaaaa
<iframe Src="http://localhost/" width=300 height=200 Name="Page1"></iframe>
<iframe Src="about:blank" width=300 height=200 Name="Page2"></iframe>
</body>
</html>跟踪了一下,如果WEB.oleobject.document.documentelement.document.frames.item(j).document就这一项出错。
但是能够访问Page2也就是Frames.items(1)的内容如果把HTML换成两个iframe的src都换成about:blank,程序就不会有问题。开发环境:Delphi 7 , XP SP2
在2000下运行没问题,真是郁闷。XP SP1运行同样要出错。
解决方案 »
- 江湖救急 FindWindowEX怎么循环使用
- TADODataSetk控件如何在运行期间,获取字段名列表?其中CommandType=cmdStoredProc.?
- 急急急,有关RAVE报表的问题---在线等
- 完全动态生成报表问题??????
- FastReport如何设置用自定义纸型横打?
- 关于程序的打包问题,再线等待
- 怎样对扫描出的TIF格式的图片进行纠正歪斜,去污、去黑边的处理?
- mediaplayer播放数据库文件
- 此问题没有一个完美的解决方法,怎么大家都不关心?????
- 清华出的《delphi 4.0/5.0类参考详解》、《delphi 4.0/5.0高级类参考详解》两本书有必要买吗?
- 巨分!巨难!如何用图片做异形窗体...我的意思是指可以改变 size 的那种哦,网络上全部是单个图片不能动 size 的那种!
- 解密,OLLYICE软件
localhost和about:blank所处的域不同