Open a webpage in the default browser

后端 未结 8 1689
我寻月下人不归
我寻月下人不归 2020-12-03 20:39

I want my users to be able to click a button to open my company\'s webpage in the default browser when clicked. How would I do this?

I\'m using VB.net so all .net e

8条回答
  •  执念已碎
    2020-12-03 21:28

    Dim URL As String 
    Dim browser As String = TextBox1.Text
    URL = TextBox1.Text
    Try
        If Not (browser = TextBox1.Text) Then
            Try
                Process.Start(browser, URL)
            Catch ex As Exception
                Process.Start(URL)
            End Try
        Else
            Process.Start(URL)
        End If
    
    Catch ex As Exception
        MsgBox("There's something wrong!")
    End Try
    

提交回复
热议问题