sab669
sab669

Reputation: 4104

How can you set the value of a textbox on a webpage from a WinForms application?

I'm developing an internal .NET WinForms tool which can launch IE to a specific internal website. I'd like to be able to automatically set the values of the username / password textboxes in the browser, but I don't know if this is possible.

I do know the control names as I have access to the source code for that web application, but I can't seem to find any examples of how to interact with an independent browser control like that.

Something like

Process.Start("mywebsite.com/login.aspx?uname=" + txtUN.Text + "&pw=" + txtPW.Text);

But since the web app isn't really expecting any parameters in the URL it's not going to do anything with that.

Something similar to this, I guess :

starting browser and passing data to it from winform application

But that question has no accepted solution, and while I have access to the source code this isn't something I can change really. So if there's a way to do it without modifying the web application, that'd be great.

Upvotes: 0

Views: 397

Answers (1)

Yoad Snapir
Yoad Snapir

Reputation: 538

I suggest looking at browser automation libraries like WatiN or Coypu that automate the browser application itself, accessing the controls by their name.

This reminds me also of Selenium but it is Java based and last i checked it has no .Net bindings.

Upvotes: 1

Related Questions