IHTMLDocument2.write () - PullRequest
       4

IHTMLDocument2.write ()

1 голос
/ 01 марта 2012

Я пишу приложение, которое проверяет некоторые данные на странице we, поэтому я пытаюсь записать весь html в IHTMLDocument2, но программа блокирует метод write (). Я имею в виду, что это не останавливается, оно просто блокируется. Вот код:

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);

1 Ответ

0 голосов
/ 08 февраля 2018

Я знаю, что это немного поздно, но вы можете попробовать следующее:

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);
            }
        }
    }
...