pathtoolongexception

PathTooLongException in C# code

[亡魂溺海] 提交于 2019-11-26 22:10:40
问题 i have the following code: public static void Serialize() { List<string> dirs = FileHelper.GetFilesRecursive(fileDirectoryPath); List<string> dirFiles = new List<string>(); foreach (string p in dirs) { string path = p; string lastAccessTime = File.GetLastAccessTime(path).ToString(); bool DirFile = File.Exists(path); FileInfo fInf = new FileInfo(path); long lengthInk = fInf.Length / 1024; DateTime lastWriteTime = File.GetLastWriteTime(p); dirFiles.Add(p + "|" + lastAccessTime.ToString() + "|"