You can verify this upper value with the following C # code.
// ------------------------------------------------------------------------------------------------------------- -------//<copyright file= "Program.cs" company= "Chimomo ' s Company" >//Respect the work.//</copyright>//&L t;summary>//the program.//</summary>//---------------------------------------------------------------- ----------------------------------------------------namespace csharplearning{using System.IO; <summary>//The program. </summary> public static Class Program {///<summary>//the main. </summary> public static void Main () {directory.createdirectory (@ "D:\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\ "); } }}
Above the code, the string D:\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ T\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ T\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ is exactly 247 bytes. , add one more character and you'll get an error:
Unhandled Exception:System.IO.PathTooLongException:The specified path, file name, or both is too long. The fully qualified file name must is less than 260 characters, and the directory name must is less than 248 characters.
At System.IO.Directory.InternalCreateDirectory (string fullPath, String path, Object dirsecurityobj, Boolean checkhost)
At System.IO.Directory.InternalCreateDirectoryHelper (String path, Boolean checkhost)
At System.IO.Directory.CreateDirectory (String path)
At CSharpLearning.Program.Main () in D:\My Project\learning\csharplearning\csharplearning\program.cs:line 24
Press any key to continue ...
This verifies that the maximum path length in Windows is 248 bytes (because Windows adds a "s" at the end of the path name). However, you can still manually make a path longer than 248 bytes, simply rename a folder in the path created by code above so that its folder name is longer than 1 bytes.