Opening Default Browser to a specific page

  • Thread starter Thread starter Mike Fellows
  • Start date Start date
M

Mike Fellows

when i click a button i want to open the machines default web browser to a
specific page

how do i do this?


Regards


Michael Fellows
 
Hi mike

rougly typed

\\\\
mywebbrowser.navigate2("myUrl")
///

I hope this helps?

Cor
 
Thanks alot for your help guys that worked a treat, excpet you need the URL
in brackets :-)

Mike
 
Just use the following in the Click_Event handler:

System.Diagnostics.Process.Start(URL)

where URL is a string containing the url of the website
that the default browser should open to. For example:

Dim URL As String = "http://www.google.com/"
System.Diagnostics.Process.Start(URL)

If you want to specify the browser to use, say Internet
Explorer, just use the following:

Dim URL As String = "http://www.google.com/"
System.Diagnostics.Process.Start("IExplore", URL)

If you want to specify Mozilla as the browser to use, use
the following code:

Dim URL As String = "http://www.google.com/"
System.Diagnostics.Process.Start("Mozilla", URL)

In fact, you can start any application this way. for
example, to fire up Notepad, use this:

System.Diagnostics.Process.Start("Notepad")

The parameter to pass is simply the name of the
executable file without the .exe extension.

Norm Bell
 
I forgot to put the " " marks around it.

Cheers - OHM
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top