I am trying to get to a file located in
C:\Program Files (x86)\test software\myapp\demo.exe
In VS debugger i see the path as:
"\"C:\\\Program Files (x86)\\\test software\\\myapp\\\demo.exe\""
when i print it out i see in console :
"C:\Program Files (x86)\test software\myapp\demo.exe"
but when i try something like
FileInfo fi = new FileInfo(PathMentionedAbove);
i get Illegal character in path.
What is wrong? the file exists and path is correct. what's illegal above this path?
any help would be appreciated.
Your path includes " at the beginning and at the end. Drop the quotes, and it'll be ok.
The \" at the beginning and end of what you see in VS Debugger is what tells us that the quotes are literally in the string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With