Do you need to show form when web page exists?
Imports System.Net
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myClient As WebClient = New WebClient()
Dim response As Stream
Try
response = myClient.OpenRead("http://www.contoso.com/index.htm")
'Process.Start("notepad.exe") '' modify it to your process
Dim f As New Form
f.Show()
Catch wex As WebException
' The stream data is used here.
Console.WriteLine("The URI formed by combining BaseAddress, address is invalid")
Console.WriteLine(wex.Message)
Catch ex As Exception
Console.WriteLine(ex.Message)
Finally
response.Close()
End Try
End Sub
End Class
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.