I'm trying to make my image viewer app work with files that are opened by clicking an image file directly inside a Zip folder (using windows explorer to browse Zip files). The application seems to be run with correct command line, which looks like this:
"C:\myApp.exe" "C:\Users\Admin\AppData\Local\Temp\Temp1_Wallpapers.zip\Wallpaper1.jpg"
The file is being read with the following code:
using (var fs = new FileStream(path, FileMode.Open))
And the exception is thrown at that line:
Exception:Thrown: "Access to the path 'C:\Users\Admin\AppData\Local\Temp\Temp1_Wallpapers.zip\Wallpaper1.jpg' is denied." (System.UnauthorizedAccessException)
A System.UnauthorizedAccessException was thrown: "Access to the path 'C:\Users\Admin\AppData\Local\Temp\Temp1_Wallpapers.zip\Wallpaper1.jpg' is denied."
I figured this may be a problem with how the path is interpreted. There's a .zip
in the middle of it, so this could be the problem, but I don't know how to solve that.
Also, simply opening a file at that path directly (not through zipped folder explorer window) results in the same exception.