I have a problem with saving. I need to images which path's are longer than the 260 characters (Sadly they have to be this long. Not my idea!)
I found this one here: https://blogs.msdn.microsoft.com/bclteam/2007/03/26/long-paths-in-net-part-2-of-3-long-path-workarounds-kim-hamilton/
I tried the \?\ but it didn't work.
My path is: "\\?\D:\Temp1\Data\" In this case Visual Studio says that there is an unknown escape sequence.
Code:
RootDir = "\\?\"+RootDir;
Exception: None. Visual Studio simply says there is an unknown escape sequenz
Then i tried @"\\?\D:\Temp1\Data" Visual Studio says that there is a sign which is not allowed. I guess it is the "?" Code:
RootDir = @"\\?\"+RootDir;
Exception: illegal character in path. Maybe this helps in this case: System.Security.Permissions.FileIOPermission.CheckIllegalCharacters(String[] str)
And when I try it without the \\?\ there is the windows exception which says that the Path only allows 260 characters.
What mistake/s did i do?
I hope you can help me.
Best regards Richard
What I have tried:
These links: https://blogs.msdn.microsoft.com/bclteam/2007/03/26/long-paths-in-net-part-2-of-3-long-path-workarounds-kim-hamilton/