Using .net to enter form values (WebClient)

  • Thread starter Thread starter Tom Yates
  • Start date Start date
T

Tom Yates

Hi,

I'd like to write a web service that goes to a specified web page, enters
some data in the forms on there and gets the response. Can anyone give me a
helping hand to get started (like open a page and enter one value on a
form)? Thanks!

Tom
 
What you can do is find out what page that the form with the fields on it is
being posted to, and then send your request to that page, instead of trying
to fill out fields on the form. You can potentially send them in the URL,
for example:

If the page has a form which is being posted to ReceiveData.aspx, and the
page has a field with an ID of 'Name', you may be able to just go the the
page 'http://www.myweb.com/ReceiveData.aspx?Name=Tom' and get the desired
result.


-Darrin
 
You will have to use HttpWebRequest class in the web
service to call the PROCESSING page (not necessary the
page when data is entered). You will have to build the
post data by yourself.
 
Back
Top