• 0

[vb.net] Default Browser


Question

13 answers to this question

Recommended Posts

  • 0

Hmm, I don't know :unsure: I know in C# there's an "Always Use Internet Explorer" flag in the project's properties you can set to false. But I think it should open the default browser by itself :huh:

Link to comment
Share on other sites

  • 0
Imports System.Diagnostics
...
Dim psi as ProcessStartInfo = new ProcessStartInfo()

psi.FileName = linkLabel1.Text
psi.Verb = "open"

Process.Start( psi )
...

Link to comment
Share on other sites

  • 0

An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.dll

Additional information: The system cannot find the file specified

Link to comment
Share on other sites

  • 0

Sorry... you'll probably want the linkdata of the of the link clicked, not the text, unless the text is the actual URL.

Also, it helps if you post the code that you think may be causing the problem. Troubleshooting from just an exception is difficult, or impossible.

An example...

   Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
        Dim psi As ProcessStartInfo = New ProcessStartInfo
        psi.FileName = CType(e.Link.LinkData, String)
        psi.Verb = "open"

        Process.Start(psi)
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        LinkLabel1.Links.Add(0, LinkLabel1.Text.Length, "https://www.neowin.net")
    End Sub

[edit]

cool. glad you got it.

Link to comment
Share on other sites

  • 0

ehh.. i just do

Process.Start("https://www.neowin.net")

And it works.

Whats all that other stuff weenur? :p

Link to comment
Share on other sites

  • 0
ehh.. i just do

Process.Start("https://www.neowin.net")

And it works.

Whats all that other stuff weenur? :p

Just what I was going to say, its a single line of code ! :happy:

Link to comment
Share on other sites

  • 0

OK, smartasses. :) I was trying to be illustrative. Obviously the guy is a noob. All you veterans can take shortcuts and have an understanding of what is going on...

Smartasses. ;)

Link to comment
Share on other sites

  • 0
OK, smartasses. :) I was trying to be illustrative. Obviously the guy is a noob. All you veterans can take shortcuts and have an understanding of what is going on...

Smartasses. ;)

My bum cheek isn't intelligent :p

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.