How to submit a web form from a windows app?

  • Thread starter Thread starter Ken Sturgeon
  • Start date Start date
K

Ken Sturgeon

Is it possible to submit a web form from a windows application using vb.net?
Can anyone point me to an example on how I might accomplish this?

Thanks

Ken
 
Ken,

It is depending from the version and there are a lot of tools, so let us
start to ask you .

What version is VB.Net (framework type and version of VBNet itself)
What kind of webserver

Cor
 
Doh,

I overreaded the words "from a windows" application.

You can forever make your own FTP. In VB2005 are there standard tools for
that. While those are in 2002/2003 as well however harder to find.

If you cannot do it with FTP than you have to look for HTTP response and
request on MSDN

Cor
 
Yes you can

Dim Myweb As New WebClient

Myweb.Headers.Add("Content-Type", "application/x-www-form-urlencoded")

Dim byteArray As Byte() =
System.Text.Encoding.ASCII.GetBytes("yourpostkey=yourpostvalue")

Dim responseArray As Byte() =
Myweb.UploadData("http://www.dummyadress.com/dummypage.webextension",
"POST", byteArray)

Dim test as string =System.Text.Encoding.ASCII.GetString(responseArray)

test now contains the reponse in a string from the webpage you posted to

regards

Michel Posseth [MCP]
 
Thanks to all for your help. I haven't quite gotten this to work but at
least you've got me pointed in the right direction.

Thanks again,
Ken
 
Ken ,

If you need aditional help feel free to ask , try some of the example code
and if it doesn`t forfill your needs or you can`t get it running post the
trouble code in a new thread with the explanation why or what isn`t working
and we can have a look at it

I have used the described technique ( example of Herrfried and Mine ) manny
times for access to my own and third party websites without problems, it is
just a mather of knowing the right parameters the website is expecting wich
you can find in the pages HTML source ( wich you can see in the webbrowser )
..


regards

and wishing you and your family or anyone who reads this thread a happy
new year

Michel Posseth
 
Thank you very much for the offer Michael. I may very well impose on your
generosity in the future as I've kind of put this particular aspect of my
project on the back burner to work other pieces of it.

Ken
 

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