2012-02-29 2 views
1

우리 페이지의 일부 데이터를 검사하는 응용 프로그램을 작성 중이므로 IHTMLDocument2에 전체 HTML을 쓰려고 시도하지만 프로그램이 write() 메서드를 잠급니다. 나는 그것이 멈추지 않는다는 것을 의미한다, 그것은 단지 잠긴다. 여기에 코드입니다 :이 조금 늦게 알고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

대신 – SLaks

+0

당신이 덤프 가지고 http://htmlagilitypack.codeplex.com/를 사용한다 '_res'의 값은 어딘가에 있고 그 제정신이 맞는지 확인할 수 있습니까? –

+0

내가 틀릴 수도 있지만, 내가 기억하는 것으로부터 먼저 빈 페이지로 이동 한 다음 사용자 지정 문자열을 문서에 써야합니다. 그냥 시도해보고 도움이되는지 알려주십시오. –

답변

0

,하지만 당신은 다음과 같은 시도 할 수 있습니다 :

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