How to open a HTML page ?

Visual Basic:
    Private Sub btnLaunch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLaunch.Click

             System.Diagnostics.Process.Start("iexplore.exe", "http://www.google.com")
       

    End Sub
 
Then you'd do the same thing. The argument that iexplore.exe accepts it a URL which doesn't have to use http. Just provide the file path and it should work.
 
Yes. it works ! thank you very much.

Another questions , what if we want to execute a batch file ? waht we should replace the "*iexplorer.exe" in syntax.
 
Just use the Start method with on param, as in:
Visual Basic:
System.Diagnostics.Process.Start("http://www.google.com")
System.Diagnostics.Process.Start("c:\test.bat")

(You might need to double up on the backslashes, can't remember if VB needs that or just C#).

In the first line, the command will open Google in whatever the default browser is. This is preferred over using the name "iexplore.exe" in case that name changes or in case the user just hates IE and loves netscape.

The second line just executes the file - can be EXE, COM, VBS, WSH, BAT, etc. - they're all considered executables, in a fashion.

-Nerseus
 
Back
Top