How to populate a WebBrowser TextBox?

I want to enter this site with my user and password from the winforms application, I display the page in a web browser control, any ideas?

+3
source share
5 answers

You need to write code to find the tag or id controls, e.g.

webBrowser1.Document.GetElementById ("textName"). SetAttribute ("value") = "ddddd";

Before this code, just make sure the document is fully loaded. You can use WebBrowserDocumentCompletedEventHandler to check for this.

+7
source

webBrowser1.Document.GetElementById("ctl00$cphMainPageBody$txtDUNS").SetAttribute("value" ,"123456");
+3

-, watin. , , , , .

+1

: webBrowser1.Document.GetElementById( "ClientLogin" ) InvokeMember ("click");.

+1

Install Firebug in Firefox and open the firebug console to view the postback that is sent when you log in. You can then use this information to perform the postback using the WebRequest class to log in directly from your Winform application.

0
source

Source: https://habr.com/ru/post/1731083/


All Articles