Hi, I've created a browser for both internet and internal files on my intranet.
Basically i've included an "Open" button the explorer. When a user click open, an Open Dialog shows on screen. The user then selects a file to open, if its a file that the browser can handle it appears in the explorer window and if not.... This is where my problem is.
I can use: System.Diagnostics.Process.Start( _
OpenDialog.FileName)
to open everything, but i want this part of the code to only kick in if the file extention is .exe, other wise i want the broswer to try and handle it.
Is this possible? i.e.:
If file extension = .exe then
System.Diagnostics.Process.Start( _
OpenDialog.FileName)
else: open in browser
End If
Here is my code for the open button,
Private Sub BtnOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOpen.Click
OpenDialog.ShowDialog()
Dim WB As CustomBrowser = Me.TabControl1.SelectedTab.Tag
WB.Navigate(OpenDialog.FileName)
On Error Resume Next
'System.Diagnostics.Process.Start( _
'OpenDialog.FileName)
End Sub
Basically i've included an "Open" button the explorer. When a user click open, an Open Dialog shows on screen. The user then selects a file to open, if its a file that the browser can handle it appears in the explorer window and if not.... This is where my problem is.
I can use: System.Diagnostics.Process.Start( _
OpenDialog.FileName)
to open everything, but i want this part of the code to only kick in if the file extention is .exe, other wise i want the broswer to try and handle it.
Is this possible? i.e.:
If file extension = .exe then
System.Diagnostics.Process.Start( _
OpenDialog.FileName)
else: open in browser
End If
Here is my code for the open button,
Private Sub BtnOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOpen.Click
OpenDialog.ShowDialog()
Dim WB As CustomBrowser = Me.TabControl1.SelectedTab.Tag
WB.Navigate(OpenDialog.FileName)
On Error Resume Next
'System.Diagnostics.Process.Start( _
'OpenDialog.FileName)
End Sub