C#中输出ASCII字符表

using System;


namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            for (int i = 1; i <= 255; i++) {
                char c = (char)i;//通过强制类型转换来将ASCII码对应的字符数出
                Console.WriteLine(i + "  " + c);
            }
        }
    }
}
//不过由于有不可打印符号,打印不会按预期结果出现

你可能感兴趣的:(C#,C#)