System.IO.Path.InvalidPathChars Field

Provides a platform-specific array of characters that cannot be specified in path string arguments passed to members of the System.IO.Path class.

Syntax

[System.Obsolete("see GetInvalidPathChars and GetInvalidFileNameChars methods.")]
public static readonly char[] InvalidPathChars

Remarks

The array returned from this method is not guaranteed to contain the complete set of characters that are invalid in file and directory names. The full set of invalid characters can vary by file system. For example, on Windows-based desktop platforms, invalid path characters might include ASCII/Unicode characters 1 through 31, as well as quote ("), less than (<), greater than (>), pipe (|), backspace (\b), null (\0) and tab (\t).

Note:

Do not use Path.InvalidPathChars if you think your code might execute in the same application domain as untrusted code. Path.InvalidPathChars is an array, so its elements can be overwritten. If untrusted code overwrites elements of Path.InvalidPathChars, it might cause your code to malfunction in ways that could be exploited.

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0