2014-12-01 110 views
0

我想一些源代碼在網站上自動登錄自動登錄網站GeckoFX [C#]

例如:

WebBrowser1.Document.GetElementById("username").SetAttribute("Value", textBox2.Text); 
WebBrowser1.Document.GetElementById("password").SetAttribute("Value", textBox3.Text); 
WebBrowser1.Document.GetElementById("login").Invokemember("Click"); 

我想壁虎

回答

0
 GeckoInputElement Username = new GeckoInputElement(geckoWebBrowser1.Document.GetElementsByName("username")[0].DomObject); 
     Username.Value = textBox2.Text; 
     GeckoInputElement Password = new GeckoInputElement(geckoWebBrowser1.Document.GetElementsByName("password")[0].DomObject); 
     Password.Value = textBox3.Text; 
     GeckoInputElement login = new GeckoInputElement(geckoWebBrowser1.Document.GetElementsByName("login")[0].DomObject); 
     login.Click();