Getting around PathTooLongException on file move with Windows Native A(galratner.com)
submitted by
galratner(334) 1 year, 3 months ago
If you ever got the error message “The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. “ you are probably aware that there is no practical way of moving files with long paths using System.IO.File. The solution is to use the Native Windows API. You can see the API here: http://msdn.microsoft.com/en-us/library/aa364232(v=VS.85).aspx
Here is a little helper class I wrote to utilize the native API from .NET:
|category: C#
|Views: 6
tags:
C# another
Everyones tags:
Your Tags: