我正在编写一个应用程序来检查we页面上的一些数据,所以我尝试在IHTMLDocument2中编写整个html,但是程序锁定在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);发布于 2018-02-08 06:38:32
我知道这有点晚了,但你可以尝试以下方法:
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);
}
}
}https://stackoverflow.com/questions/9506910
复制相似问题