You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#pragma warning disable SEC0116//Warning SEC0116 Unvalidated file paths are passed to a file delete API, which can allow unauthorized file system operations (e.g. read, write, delete) to be performed on unintended server files.
returnPath.GetFullPath(path);//GetFullPath: convert relative path to full path
51
+
52
+
46
53
//@"\\?\" prefix is needed for reading from long paths: https://stackoverflow.com/questions/44888844/directorynotfoundexception-when-using-long-paths-in-net-4-7 and https://superuser.com/questions/1617012/support-of-the-unc-server-share-syntax-in-windows
47
54
48
55
if(path.Substring(0,2)==@"\\")//network path or path already starting with \\?\
@@ -51,10 +58,20 @@ public static string GetLongPath(string path)
51
58
}
52
59
else
53
60
{
54
-
return@"\\?\"+path;
61
+
return@"\\?\"+Path.GetFullPath(path);//GetFullPath: convert relative path to full path
0 commit comments