programmatically fill out an external webform

  • Thread starter Thread starter cgian31
  • Start date Start date
C

cgian31

I need to access an info page in an external website, normally
accessible after filling username and password in a form.

I would like to hide this complexity (!) from the user, allowing them
to access it through an internal web page (which I would design) maybe
with a simple hyperlink.

How could I use ASP.NET for designing a webpage that will
programmatically fill out two fields (user and password) in a simple
html form (through https)?

The application will fill the two fields and virtually click the
"login" button
on the web form.

I lack the overview how to practically do this.
 
cgian31 said:
I need to access an info page in an external website, normally
accessible after filling username and password in a form.

I would like to hide this complexity (!) from the user, allowing them
to access it through an internal web page (which I would design) maybe
with a simple hyperlink.

How could I use ASP.NET for designing a webpage that will
programmatically fill out two fields (user and password) in a simple
html form (through https)?

The application will fill the two fields and virtually click the
"login" button
on the web form.

I lack the overview how to practically do this.

You could use the System.Net.HttpWebRequest class to send the request
to your remote web page.

eg: HttpWebRequest myReq =
(HttpWebRequest)WebRequest.Create("https://www.remoteserver.com/");


So a search on HttpWebRequest on Google.. otherwise the following I
found is a good example:

http://weblogs.asp.net/guys/archive/2005/06/21/414118.aspx

Good Luck!

Dirc

--
 
cgian,

You don't need to fill out the page and "click" the button.

Just send the page that would normally receive the first one the data it
needs.

Use a WebRequest object and post to the receiving page.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
Thank you all for your replies.

I cannot use the receiving page with the appopriate query strings
because my destination is an asp page/form having two fields:
Username/Password and a button: Login.
When the username/pwd fields are filled in and the Login button is
pressed, the application generates a 15 fugures code, always different,
which is then embedded into the url with this style:
https://url.com/default.asp?<15 figures code>

Since I don't know the code, I cannot access the second page directly,
but I need to fill in the first form in order for the application to
generate this code.

I see that the HttpWebRequest class is what I need, but how to match
the userid/pwd I pass with the respective fields in the asp
application? Can anybody give me another small hint?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top