Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need to post 2 or more variables

Status
Not open for further replies.

stnkyminky

Programmer
Oct 15, 2001
476
US
I need to post 2 or more variables to a website. I can successfully post 1 given the code below.

As you can see I've tried to add multiple variables unsuccessfully.

Dim web As New System.Net.WebClient

web.Headers.Add("Content-Type", "application/x-
'Works
Dim d As Byte() = System.Text.Encoding.ASCII.GetBytes("username=test")
'Doesn't work
Dim d As Byte() = System.Text.Encoding.ASCII.GetBytes("username=test",pwd=foo")
Dim res As Byte() = web.UploadData(" "POST", d)

Console.Write(System.Text.Encoding.ASCII.GetString(res))

Scott
Programmer Analyst
<{{><
 
sorry that was a typo

Dim d As Byte() = System.Text.Encoding.ASCII.GetBytes(&quot;username=test&quot;, &quot;pwd=foo&quot;)

That produces an error.....doesn't accept this number of arguments.


thx for the interest.

Scott
Programmer Analyst
<{{><
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top