By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,469 Members | 1,259 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,469 IT Pros & Developers. It's quick & easy.

How to autofill a web login page and autosubmit?

P: n/a
I have a login.aspx page consisting of a username label and textbox,
password label and textbox and a submit button.

I want to programmatically autofill this and post it back.

I am using the ActiveX IE/Browser object to navigate to the windows page
However, I'm unsure of how to post the info back to the server.

Any suggestions are welcome.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 15 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Morten,

If you are using the WebBrowser object, then in the Navigate method,
there is a parameter which will take the extra information to post to the
server. It is here that you would set the username and the password to
whatever you would fill in on the label. This would also require you to use
a POST method, as opposed to a GET method (well, depending on the form
anyways).

Also, are you using .NET on the client side? Have you considered using
the HttpWebRequest and HttpWebResponse classes?

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Morten Wennevik" <mo************@hotmail.com> wrote in message
news:opru6ihcqrge0n9a@localhost...
I have a login.aspx page consisting of a username label and textbox,
password label and textbox and a submit button.

I want to programmatically autofill this and post it back.

I am using the ActiveX IE/Browser object to navigate to the windows page
However, I'm unsure of how to post the info back to the server.

Any suggestions are welcome.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

Nov 15 '05 #2

P: n/a
On Mon, 8 Sep 2003 08:40:54 -0400, Nicholas Paldino [.NET/C# MVP]
<ni**************@exisconsulting.com> wrote:
Morten,

If you are using the WebBrowser object, then in the Navigate method,
there is a parameter which will take the extra information to post to the
server. It is here that you would set the username and the password to
whatever you would fill in on the label. This would also require you to
use
a POST method, as opposed to a GET method (well, depending on the form
anyways).

I've tried setting postData =
"__VIEWSTATE=xxx...&Username=myname&Password=mypas sword"
xxx... is the viewstate number
but I'm unsure of how to use postData. Also how would I use POST/GET?
The server is using sessionstates so I'm assuming I need to include
viewstate.
Also, are you using .NET on the client side? Have you considered using
the HttpWebRequest and HttpWebResponse classes?

I am using C# in Visual Studio.Net, so... yes :)
I have used WebRequest/Response in a regular web browser app, but I'm not
too familiar with it.
Hope this helps.


Thanks
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 15 '05 #3

P: n/a
Morten,

I would suggest using the HttpWebRequest and HttpWebResponse classes if
you don't need to display the content that you download. It will give you
more control and better performance.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Morten Wennevik" <mo************@hotmail.com> wrote in message
news:opru6m1qlkge0n9a@localhost...
On Mon, 8 Sep 2003 08:40:54 -0400, Nicholas Paldino [.NET/C# MVP]
<ni**************@exisconsulting.com> wrote:
Morten,

If you are using the WebBrowser object, then in the Navigate method,
there is a parameter which will take the extra information to post to the server. It is here that you would set the username and the password to
whatever you would fill in on the label. This would also require you to
use
a POST method, as opposed to a GET method (well, depending on the form
anyways).


I've tried setting postData =
"__VIEWSTATE=xxx...&Username=myname&Password=mypas sword"
xxx... is the viewstate number
but I'm unsure of how to use postData. Also how would I use POST/GET?
The server is using sessionstates so I'm assuming I need to include
viewstate.
Also, are you using .NET on the client side? Have you considered using
the HttpWebRequest and HttpWebResponse classes?


I am using C# in Visual Studio.Net, so... yes :)
I have used WebRequest/Response in a regular web browser app, but I'm not
too familiar with it.
Hope this helps.


Thanks
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

Nov 15 '05 #4

P: n/a
Thanks, I tried using httpwebrequest/httpwebresponse, but I can't seem to
get redirects.

On Mon, 8 Sep 2003 09:31:07 -0400, Nicholas Paldino [.NET/C# MVP]
<ni**************@exisconsulting.com> wrote:
Morten,

I would suggest using the HttpWebRequest and HttpWebResponse classes if
you don't need to display the content that you download. It will give
you
more control and better performance.


--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.