How can I extend the Path.GetInvalidFileNameChars to include my own set of characters that is illegal in my application?
string invalid = new string(Path.GetInvalidFileNameChars()) + new string(Path.GetInvalidPathChars());
If I wanted to add the ‘&’ as an illegal character, could I do that?
You can’t modify an existing function, but you can write a wrapper function that returns
Path.GetInvalidFileNameChars()and your illegal characters.