Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub checkOnline(ByVal inEsecuzione As Boolean)
- Dim s As HttpWebRequest
- Dim enc As UTF8Encoding
- Dim postdata As String
- Dim postdatabytes As Byte()
- Try
- s = HttpWebRequest.Create("http://www.tuosito.com/check.php")
- enc = New System.Text.UTF8Encoding()
- If inEsecuzione Then
- postdata = "start=1"
- Else
- postdata = "start=0"
- postdatabytes = enc.GetBytes(postdata)
- s.Method = "POST"
- s.ContentType = "application/x-www-form-urlencoded"
- s.ContentLength = postdatabytes.Length
- Using stream = s.GetRequestStream()
- stream.Write(postdatabytes, 0, postdatabytes.Length)
- End Using
- Dim result = s.GetResponse()
- End If
- Catch Ex As Exception
- MessageBox.Show(Ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
- End Try
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement