Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 startInfo As New Diagnostics.ProcessStartInfo()
    startInfo.FileName = url
    startInfo.WindowStyle = ProcessWindowStyle.Maximized
    Return System.Diagnostics.Process.Start(startInfo)
 End Function

A couple of times the function returned the error (on users machine) "the system cannot find the file specified"

I guess the user has not set a default web browser. Why i get this error? How could i add a default web browser check before calling this function?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

 Private Sub helpRichTextBox_LinkClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.LinkClickedEventArgs) Handles helpRichTextBox.LinkClicked
        System.Diagnostics.Process.Start(e.LinkText)
    End Sub

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...