Imports System.Net
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim request = DirectCast(WebRequest.Create("http://localhost/11.txt"), WebRequest)
Try
Dim response As WebResponse = DirectCast(request.GetResponse(), WebResponse)
MsgBox("exist")
Catch ex As WebException
Dim response As WebResponse = DirectCast(ex.Response, WebResponse)
MsgBox("no exist")
End Try
End Sub
End Class