Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Edit:</strong> The solution below fixes the OP's inability to access the dom for debugging purposes. The OP actually needs to solve the problem of the document not appearing as expected (or at all) in the <code>WebBrowserControl</code>. The <code>WebBrowserControl</code> is a repackaging of the ActiveX control of the same name and so will probably use the currently installed version of Internet Explorer. If possible, I suggest launching IE on the computer in question and attempting to render the same document, including the code used to load the document in your <code>WebBrowserControl</code> would also help us diagnose the problem.</p> <p>I think you want something along the lines of:</p> <pre><code>if (webBrowser1.Document != null) { var currentDoc = (MSHTML.IHTMLDocument2)webBrowser1.Document.DomDocument; return (currentDoc.lastModified); } </code></pre> <p>Your conversion from <code>IHTMLDocument</code> to <code>HtmlDocument</code> is invalid.</p> <p>Here's the <a href="http://msdn.microsoft.com/en-us/library/aa752574.aspx" rel="nofollow">IHTMLDocument2</a> property and method docs.</p> <p>Expanding on that, in the above example, <code>webBrowser1.Document</code> is a <code>System.Windows.Forms.HtmlDocument</code>. Its <code>DomDocument</code> property is an unmanaged pointer to the document. It's only needed when you are looking for properties of the document that are not exposed on the managed <code>Document</code> property of the browser control.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload