gpt4 book ai didi

.net - 如何获取 .Net 中 Windows 文件系统路径的所有有效文件夹和文件字符的列表

转载 作者:可可西里 更新时间:2023-11-01 11:57:58 26 4
gpt4 key购买 nike

System.IO.Path.GetInvalidPathChars() 给出无效字符列表。

但我需要有所有有效字符的列表。

第一个想到的简单想法是从 0 到 255 进行迭代并排除无效字符,但它会只给出有效字符吗?还有 Unicode 呢?我应该从 0 迭代到 65535 吗?

最佳答案

据我所知,.NET 中没有任何东西可以获取此信息。

您可以查看以下 Microsoft 页面:http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx

相关摘录:

Use any character in the current code page for a name, including Unicode characters and characters
in the extended character set (128–255), except for the following:

The following reserved characters:

< (less than)
> (greater than)
: (colon)
" (double quote)
/ (forward slash)
\ (backslash)
| (vertical bar or pipe)
? (question mark)
* (asterisk)

Integer value zero, sometimes referred to as the ASCII NUL character.

Characters whose integer representations are in the range from 1 through 31,
except for alternate data streams where these characters are allowed.

Any other character that the target file system does not allow.

关于.net - 如何获取 .Net 中 Windows 文件系统路径的所有有效文件夹和文件字符的列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13349640/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com