How to open File using System.Diagnostics.Start in the Base Root directory
-
Hi All ! I have a pdf file, place in the debug directory (in any drive) . I want to open this file with any full path :
string appPath = Path.GetDirectoryName(Application.ExecutablePath);
Process.Start(appPath + "\\Debug\\HelpFile.pdf");But I have an error that can not file file , pl z help me ! thanks in advance !
-
Hi All ! I have a pdf file, place in the debug directory (in any drive) . I want to open this file with any full path :
string appPath = Path.GetDirectoryName(Application.ExecutablePath);
Process.Start(appPath + "\\Debug\\HelpFile.pdf");But I have an error that can not file file , pl z help me ! thanks in advance !
Put a break point on the second line and see what the path is... To me it looks like you are trying to go into the debug folder from your run folder. Usually the "Debug" folder is where you are running from when using VS so you have an extra folder in the path.... P.S. Don't use text speak in forums. It is rude.
Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.
-
Put a break point on the second line and see what the path is... To me it looks like you are trying to go into the debug folder from your run folder. Usually the "Debug" folder is where you are running from when using VS so you have an extra folder in the path.... P.S. Don't use text speak in forums. It is rude.
Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.
@"..\Debug\HelpFile.pdf"); It's works ! Thanks in advance! Regards !
-
@"..\Debug\HelpFile.pdf"); It's works ! Thanks in advance! Regards !
Yeah, but when you deploy the application in production, it'll fail! Unless you have the Debug folder created when you install the application, BOOM!
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Hi All ! I have a pdf file, place in the debug directory (in any drive) . I want to open this file with any full path :
string appPath = Path.GetDirectoryName(Application.ExecutablePath);
Process.Start(appPath + "\\Debug\\HelpFile.pdf");But I have an error that can not file file , pl z help me ! thanks in advance !
I suggest you read Windows Special Folders[^]. :)
Luc Pattyn [My Articles] Nil Volentibus Arduum
-
I suggest you read Windows Special Folders[^]. :)
Luc Pattyn [My Articles] Nil Volentibus Arduum
thanx ! ;)