Getting around PathTooLongException on file move with Windows Native A(galratner.com)

submitted by galratnergalratner(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:

add a comment |category: |Views: 6

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story