首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IHTMLDocument2.write()

IHTMLDocument2.write()
EN

Stack Overflow用户
提问于 2012-03-01 05:28:53
回答 1查看 1.5K关注 0票数 1

我正在编写一个应用程序来检查we页面上的一些数据,所以我尝试在IHTMLDocument2中编写整个html,但是程序锁定在write()方法上。我的意思是它不会停止,它只是锁住了。代码如下:

代码语言:javascript
复制
result = doHTTP_Request(uri, data, _userA, cType, "POST", cookie);
String _res = (String)result[0];
cookie = (CookieContainer)result[1];

IHTMLDocument2 doc = new HTMLDocumentClass();
doc.write(_res);
EN

回答 1

Stack Overflow用户

发布于 2018-02-08 06:38:32

我知道这有点晚了,但你可以尝试以下方法:

代码语言:javascript
复制
IHTMLDocument2 doc = new HTMLDocument() as IHTMLDocument2;
DisableDebuggersAndNotification(true);
doc.write(_res);
DisableDebuggersAndNotification(false);


    private void DisableDebuggersAndNotification(bool setValue)
    {
        string val = null;
        using (RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Internet Explorer\\Main", true))
        {
            if (key != null)
            {
                val = (setValue) ? "yes" : "no";
                key.SetValue("DisableScriptDebuggerIE", val, RegistryValueKind.String);

                val = (setValue) ? "yes" : "no";
                key.SetValue("Disable Script Debugger", val, RegistryValueKind.String);

                val = (!setValue) ? "yes" : "no";
                key.SetValue("Error Dlg Displayed On Every Error", val, RegistryValueKind.String);
            }
        }
    }
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9506910

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档