Note that there are some explanatory texts on larger screens.

plurals
  1. POCant add system.windows.froms without could not be resolved error
    primarykey
    data
    text
    <p>I am a newbie to visual studio so apologies in advance for anything dumb I ask or say.</p> <p>I am trying to inject a username and password into a document and automatically sign in to a https web site.</p> <p>I use the code as follows:</p> <pre><code> using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Navigation; using System.Windows.Forms; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; using TasKey2.Resources; using System.IO.IsolatedStorage; namespace myapp { public partial class MainPage : PhoneApplicationPage { bool isLoggedOn = true; private string splashScreen = "https://xxxxxxt"; private string teamScreen = "https://xxxxxxx"; private string mainUrl; private string username, password; private bool loggedOn; System.Windows.Forms.WebBrowser webBrowser; ...... private void Browser_Loaded(object sender, RoutedEventArgs e) { Browser.IsScriptEnabled = true; if (isLoggedOn) { mainUrl = teamScreen; Browser.Navigate(new Uri(mainUrl, UriKind.Absolute)); HtmlElement userName = webBrowser.Document.GetElementById("Login1_UserName"); userName.SetAttribute("value", username); userName.RemoveFocus(); HtmlElement passWord = webBrowser.Document.GetElementById("Login1_Passwrod"); passWord.SetAttribute("value", password); HtmlElement logonForm = webBrowser.Document.GetElementById("Login1_LoginButton"); logonForm.InvokeMember("click"); } </code></pre> <p>When I do I get the following error:</p> <p>Error 1 The type or namespace name 'Forms' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) Error 2 The type or namespace name 'Forms' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?)<br> Error 3 The type or namespace name 'NavigateEventHandler' could not be found (are you missing a using directive or an assembly reference?)</p> <p>SO I go to the Object Browser and can add System.Windows.Forms v2 and v4</p> <p>Regardless of which one I addd I now get the following error:</p> <p>Error 2 The base class or interface 'System.ComponentModel.Component' in assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' referenced by type 'System.Windows.Forms.Control' could not be resolved c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Windows.Forms.dll</p> <p>I am banging my head against a bring wall on this. How do I add the System.Windows.Forms to my code and make it work?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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