'How can I open External memory file as FileStream is c#
I have a file on a external device
This PC\HERO4 Session\External Memory\DCIM\101GOPRO. Is there a way I can read this file in c# using File.OpenRead("This PC\HERO4 Session\External Memory\DCIM\101GOPRO") because when I tried to my desktop WPF app just adds the execution path and fails with FileNotFoundException.
Thanks
Solution 1:[1]
\ is a special symbol.
You can use \\ in string: File.OpenRead("This PC\\HERO4 Session\\...")
or
@ before the string File.OpenRead(@"This PC\HERO4 Session\...")
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Preslav Tsenov |
