Advertisement
Guest User

Untitled

a guest
Jan 27th, 2016
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. Public Class Form1
  2. Private Sub submit_Click(sender As System.Object, e As System.EventArgs) Handles submit.Click
  3. Dim user As String
  4. Dim pass As String
  5. user = uname.Text
  6. pass = passwd.Text
  7.  
  8. Dim request As WebRequest = WebRequest.Create("http://domain.com/test.php")
  9. request.Method = "POST"
  10. Dim postData As String
  11. postData = "username=" & user & "&password=" & pass
  12. Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postData)
  13. request.ContentType = "application/x-www-form-urlencoded"
  14. request.ContentLength = byteArray.Length
  15. Dim dataStream As Stream = request.GetRequestStream()
  16.  
  17. do what you want with the stream
  18.  
  19. reader.Close()
  20. dataStream.Close()
  21. response.Close()
  22. End Sub
  23. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement