fork download
  1. Imports System
  2. Imports System.Net
  3. Imports System.IO
  4. Imports System.Windows.Forms
  5.  
  6. Public Class Test
  7. Public Shared Sub Main()
  8. Dim rt As String = ""
  9. Dim out As String
  10. Dim wRequest As WebRequest
  11. Dim wResponse As WebResponse
  12. Dim SR As StreamReader
  13. Dim time As Date = Now
  14.  
  15.  
  16. Try
  17. wRequest = WebRequest.Create("https://w...content-available-to-author-only...e.fm")
  18. wRequest.Timeout = 10000
  19. wResponse = wRequest.GetResponse
  20. SR = New StreamReader(wResponse.GetResponseStream)
  21. rt = SR.ReadToEnd
  22. SR.Close()
  23.  
  24. Catch wex As WebException
  25.  
  26. Dim status As WebExceptionStatus = wex.Status
  27.  
  28. If status = WebExceptionStatus.Timeout Then
  29. MessageBox.Show("Could not establish a connection to the selected exchange server.", "Connection Timed Out", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  30. ElseIf status = WebExceptionStatus.ConnectFailure Then
  31. MessageBox.Show("Could not establish a connection to the selected exchange server.", "Connection Failed", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  32. ElseIf status = WebExceptionStatus.ProtocolError Then
  33. MessageBox.Show("Could not establish a connection to the selected exchange server.", "Connection Protocol Error", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  34.  
  35. End If
  36.  
  37. End Try
  38.  
  39. End Sub
  40. End Class
Success #stdin #stdout 0.21s 34544KB
stdin
Standard input is empty
stdout
Standard output is empty