1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
Dim client As HttpClient = New HttpClient()
Dim valTimeOut As TimeSpan = TimeSpan.FromSeconds(10)
client.Timeout = valTimeOut
Dim rep As HttpResponseMessage = New HttpResponseMessage
rep = Await client.GetAsync("https://**********/")
If Not ((rep.StatusCode = HttpStatusCode.Accepted) Or (rep.StatusCode = HttpStatusCode.OK)) Then
MessageBox.Show("erreur internet")
MessageBox.Show(rep.StatusCode)
End If
If rep.IsSuccessStatusCode Then
MessageBox.Show("success internet")
Else
MessageBox.Show("pas success internet")
End If
Dim read As String = rep.ToString
TextBox8.Text = read |