[英]GetInvalidFileNameChars() doesn't contain all illegal chars
根據http://msdn.microsoft.com/zh-cn/library/system.io.path.getinvalidpathchars%28v=vs.110%29.aspx,Path.GetInvalidFileNameChars Path.GetInvalidFileNameChars()
應該提供以下輸出
// Note: Some characters may not be displayable on the console.
// The output will look something like:
//
// The following characters are invalid in a path:
// Char Hex Value
// ", 0022
// <, 003C
// >, 003E
// |, 007C
// ...
//
// The following characters are invalid in a filename:
// Char Hex Value
// ", 0022
// <, 003C
// >, 003E
// |, 007C
// ...
但是我只會
Char Hex Value
, 0000
/, 002F
這是怎么回事?
從您鏈接的文章中:
從此方法返回的數組不能保證包含文件和目錄名稱中無效的完整字符集。 無效字符的完整集合可能因文件系統而異。 例如,在基於Windows的桌面平台上,無效的路徑字符可能包括ASCII / Unicode字符1到31,以及引號(“),小於(<),大於(>),豎線(|),退格鍵( \\ b),空(\\ 0)和制表符(\\ t)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.