Opening default web browser

后端 未结 5 1492
臣服心动
臣服心动 2020-12-21 08:05

I am using the function below to open the user\'s default web browser.

 Public Function ShowHelp(ByVal url As String) As System.Diagnostics.Process
    Dim s         


        
5条回答
  •  我在风中等你
    2020-12-21 08:31

    If you're running on Windows, the following command-line should work from anywhere:

    rundll32 url.dll,FileProtocolHandler 
    

    where is the webpage URL to navigate to.

    Public Function ShowHelp(ByVal url As String) As System.Diagnostics.Process
            Dim startInfo As New Diagnostics.ProcessStartInfo()
            startInfo.FileName = "rundll32 url.dll,FileProtocolHandler"
            startInfo.Arguments = url
            startInfo.WindowStyle = ProcessWindowStyle.Maximized
            Return System.Diagnostics.Process.Start(startInfo)
    End Function
    

提交回复
热议问题