Link to home
Start Free TrialLog in
Avatar of hamlin11
hamlin11

asked on

VB.NET System.Diagnostics.Process.Start(URL) -- Error Possibilities?

I built some software for a client who thinks the application is crashing when it tries to open a local URL.

The code I use for this is: System.Diagnostics.Process.Start(URL) where URL is the path to a local html file.

Is this known to not work on some systems?

Thanks for your time
ASKER CERTIFIED SOLUTION
Avatar of Toms Edison
Toms Edison
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hamlin11
hamlin11

ASKER

Is the path of the html correct? yes

Is there any app associated with html files? I have to assume yes, because it works about half of the time. I don't have access to the client's computer.

Thanks for the help
Hi,
There are two reasons for process.start to fail.
1)The path is incorrect.
2)There is no program associated with the file type or the program associated is corrupted/crashing.

I think the reason 2 is most likely cause of problem in your case.
Try using this:

Dim PSI As New System.Diagnostics.ProcessStartInfo
PSI.UseShellExecute = True ' This is important. open the file with the associated program
PSI.FileName = "url_goes_here"
Process.Start(PSI)