Submit a form from code

S

Shawn

Hi.
I'm given a URL that takes me to a page that looks someting like this:

<html xmlns:fo="http://www.w3.org/1999/XSL/Format">
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
<link href="css/default.css" REL="stylesheet">
<body onLoad="document.forms[0].submit()">

<form
action="http://internal-server//login.asp?fds=File&doc=102&current=1&seq=1"
method="post" name="form1">
<input type="hidden" name="username" style="width: 150px" value="test_user">
<input type="hidden" name="password" style="width: 150px" VALUE="test_pass">

<input type="submit" value="Login" style="width: 80px">

</form>
</body>
</html>

When the page loads it automatically logges me onto the system and then
redirects me to a file (pdf, xsl, doc etc). My problem is that I have to
download this file through my code and store it on the web server without a
user interface. Is there someone who can tell me how I can accomplish this?

Thanks,
Shawn
 
B

bhawin13

Hello Shawn,
You want to do operation idealy performed by your browser. Am I right?
Find class that that allow you to send request and able to grab the
response.
That response will be saved in variable then store it where you want.
I dont know excatly but i think you will get such class in system.net.
happy coading
bhawin13
 
B

bhawin13

Hello Shawn,
You want to do operation idealy performed by your browser. Am I right?
Find class that that allow you to send request and able to grab the
response.
That response will be saved in variable then store it where you want.
I dont know excatly but i think you will get such class in system.net.
happy coading
bhawin13
 
G

Guest

Hi Shawn, as bhawin13 suggested the class you are looking for is
System.Net.HttpWebRequest

jd
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top