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
The code I use for this is: System.Diagnostics.Process
Is this known to not work on some systems?
Thanks for your time
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.Process StartInfo
PSI.UseShellExecute = True ' This is important. open the file with the associated program
PSI.FileName = "url_goes_here"
Process.Start(PSI)
Dim PSI As New System.Diagnostics.Process
PSI.UseShellExecute = True ' This is important. open the file with the associated program
PSI.FileName = "url_goes_here"
Process.Start(PSI)
ASKER
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