title: Access denied on switching to other frame (.Net WebBrowser, MsHTML) cross-domain Exception
body: <p>i'm trying to switch for another frame (With no name or id) but getting Exception.</p>
  
  <pre><code>object index = 0;
  var frame = (mshtml.IHTMLWindow2)workDocument.frames.item(ref index);
  frameDocument = (mshtml.IHTMLDocument2)frame.document; // Exception.
  </code></pre>
  
  <p>Tried other way but the same exception:</p>
  
  <pre><code>webBrowser.Document.Window.Frames[0].Document.GetElementById("userName").SetAttribute("value", username);
  webBrowser.Document.Window.Frames[0].Document.GetElementById("userPassword").SetAttribute("value", password);
  webBrowser.Document.Window.Frames[0].Document.GetElementById("login").InvokeMember("click");
  </code></pre>
  
  <p><strong>Exception:</strong></p>
  
  <blockquote>
    <p>Access is denied. (Exception from HRESULT: 0x80070005
    (E_ACCESSDENIED))</p>
  </blockquote>
  
  <p>i understand that is a <strong>cross-domain</strong> reason, do we have solution for that cases</p>
  
  <p>Thank's</p>