根据http://msdn.microsoft.com/en-us/library/system.io.path.getinvalidpathchars%28v=vs.110%29.aspx,
然而我只得到
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
发生了什么?
Path.GetInvalidFileNameChars()
)并执行Path.GetExtension(Filename)
,它仍会抛出无效字符异常。让我很难过! - Snæbjørn