Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub submit_Click(sender As System.Object, e As System.EventArgs) Handles submit.Click
- Dim user As String
- Dim pass As String
- user = uname.Text
- pass = passwd.Text
- Dim request As WebRequest = WebRequest.Create("http://domain.com/test.php")
- request.Method = "POST"
- Dim postData As String
- postData = "username=" & user & "&password=" & pass
- Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postData)
- request.ContentType = "application/x-www-form-urlencoded"
- request.ContentLength = byteArray.Length
- Dim dataStream As Stream = request.GetRequestStream()
- do what you want with the stream
- reader.Close()
- dataStream.Close()
- response.Close()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement