Invalid path characters
In this chapter you will learn:
Invalid path characters
using System;/*from ja v a2 s. c o m*/
using System.IO;
class GetCharExample
{
public static void Main()
{
char[] invalidPathChars = Path.GetInvalidPathChars();
Console.WriteLine("The following characters are invalid in a path:");
ShowChars(invalidPathChars);
Console.WriteLine();
}
public static void ShowChars(char[] charArray)
{
foreach (char someChar in charArray)
{
Console.WriteLine("{0:c},\t{1:X4}", someChar, (int)someChar);
}
}
}
Next chapter...
What you will learn in the next chapter:
Home » C# Tutorial » File, Path