Reputation: 35
I am building a web browser and if a link is clicked, if that link contains a certain string then I want a different program to open:
Private Sub WebBrowser1_Navigated(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated
If WebBrowser1.Document.Links.Contains("STRING") Then
Process.Start("PROGRAM I WANT TO OPEN")
End If
End Sub
Upvotes: 0
Views: 739
Reputation: 1900
Try using
If InStr(e.Url.ToString, "String") Then
Process.Start("Program I want to open")
End if
Upvotes: 1