美文网首页
C# Windwos文件路径太长问题

C# Windwos文件路径太长问题

作者: UnityAsk | 来源:发表于2019-03-13 00:26 被阅读0次

当File.Create 或者 File.Copy 路径太长,超出windows限制的时候,可以在前面添加 "\?"
比如 : "\?\D:\very long path".

he Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of the GetVolumeInformation function (this value is commonly 255 characters). To specify an extended-length path, use the "\?" prefix. For example, "\?\D:\very long path".

https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file

相关文章

网友评论

      本文标题:C# Windwos文件路径太长问题

      本文链接:https://www.haomeiwen.com/subject/jzrapqtx.html