如何在WebBrowser控件中设置当前document.domain以避免“访问被拒绝”? [英] How to set current document.domain in WebBrowser Control to avoid "Access is denied"?

查看:256
本文介绍了如何在WebBrowser控件中设置当前document.domain以避免“访问被拒绝”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在WebBrowser控件中设置当前 document.domain ,以避免跨域调用(XMLHTTP请求或iframe /框架访问)中的访问被拒绝?

How can I set current document.domain in WebBrowser Control to avoid "Access is denied" in Cross-domain calls (XMLHTTP Requests or Iframe/frame access)?

我试过了

CurrentDocument = WebBrowserControl.Document
CurrentDocument.domain = "example.com"
Console.writeline("xx" & CurrentDocument.domain)


b $ b

这不工作,不知何故它从未到达console.writeline

This doesn't work, somehow it never reaches console.writeline

我做错了什么?还是应该使用 WebBrowserControl.ActiveXInstance

Am I doing something wrong? Or should I use WebBrowserControl.ActiveXInstance ?

推荐答案

写这个?您是否正在访问 .Domain 或不存在的属性.domain?

What language are you writing this in? Are you accessing the property .Domain or the non-existant property .domain?

这篇关于如何在WebBrowser控件中设置当前document.domain以避免“访问被拒绝”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆