tags:

views:

45

answers:

1

Im coding in vb.net, and I havent in forever so im a little rusty now.
Question is, I want to beable to post data to a website, it can be anything as long as it can call the url (without being in a browser).

a url like

http://website.com/login.php?username=USERNAME&password=PASS&rememberme=1
A: 

WebClient class is the easy way to go. Code sample from http://www.xtremevbtalk.com/showthread.php?t=158765

Dim oWeb As New System.Net.WebClient()

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

Dim bytArguments As Byte() = System.Text.Encoding.ASCII.GetBytes("q=InTheory")
Dim bytRetData As Byte() = oWeb.UploadData("http://www.google.com/search", "POST", bytArguments )

debug.Write(System.Text.Encoding.ASCII.GetString(bytRetData))
John K
see i tried that, and i get errors for oWeb and debug.
Joseph Robidoux
declaration error
Joseph Robidoux
John K
yes, i do that and i getThe remote server returned an error: (405) Method Not Allowed.
Joseph Robidoux
The 405 is a different question. Search for it or post another question about that particular problem on StackOverflow. This isn't a debugging thread and the original question has been answered.
John K