Archived

This topic is now archived and is closed to further replies.

VB .NET : opening web browser

This topic is 5601 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i have the following code to open a web brower. It works fine with VB6, but it doesnt with VB .NET Private Declare Function ShellExecute Lib _ "shell32.dll" Alias "ShellExecuteA" _ (ByVal hWnd As Long, ByVal lpOperation _ As String, ByVal lpFile As String, ByVal _ lpParameters As String, ByVal lpDirectory _ As String, ByVal nShowCmd As Long) As Long Call ShellExecute(0&, vbNullString, "http://www.google.com", vbNullString, vbNullString, 1) Any idea ? Thanks
www.web-discovery.net

Share this post


Link to post
Share on other sites
Something like this will do the trick:

  
System.Diagnostics.Process.Start( "http://www.google.com" );


If you need more control over the process, take a look at the docs for the Process class: ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemDiagnosticsProcessClassTopic.htm





"It is precisely because it is fashionable for Americans to know no science, even though they may be well educated otherwise, that they so easily fall prey to nonsense. They thus become part of the armies of the night, the purveyors of nitwittery, the retailers of intellectual junk food, the feeders on mental cardboard, for their ignorance keeps them from distinguishing nectar from sewage."
Isaac Asimov

Share this post


Link to post
Share on other sites