ASCII Class For C# With Decimal, Binary, Hex Value
public static class ASCII
{
public class Columns
{
public string CharacterName { get; set; }
public string Char { get; set; }
public string Code { get; set; }
public string Decimal { get; set; }
public string Binary { get; set; }
public string Hex { get; set; }
}
public static List<Columns> GetASCIICodeList()
{
List<Columns> ASCII_Code_List = new List<Columns>()
{
//new Columns { CharacterName = "", Char = "", Code = "", Decimal = "", Binary = "", Hex = "" },
new Columns {CharacterName = "Null", Char = "NUL", Code = "Ctrl @", Decimal = "0", Binary = "00000000", Hex = "00"},
new Columns {CharacterName = "Start of Heading", Char = "SOH", Code = "Ctrl A", Decimal = "1", Binary = "00000001", Hex = "01"},
new Columns {CharacterName = "Start of Text", Char = "STX", Code = "Ctrl B", Decimal = "2", Binary = "00000010", Hex = "02"},
new Columns {CharacterName = "End of Text", Char = "ETX", Code = "Ctrl C", Decimal = "3", Binary = "00000011", Hex = "03"},
new Columns {CharacterName = "End of Transmit", Char = "EOT", Code = "Ctrl D", Decimal = "4", Binary = "00000100", Hex = "04"},
new Columns {CharacterName = "Enquiry", Char = "ENQ", Code = "Ctrl E", Decimal = "5", Binary = "00000101", Hex = "05"},
new Columns {CharacterName = "Acknowledge", Char = "ACK", Code = "Ctrl F", Decimal = "6", Binary = "00000110", Hex = "06"},
new Columns {CharacterName = "Bell", Char = "BEL", Code = "Ctrl G", Decimal = "7", Binary = "00000111", Hex = "07"},
new Columns {CharacterName = "Back Space", Char = "BS", Code = "Ctrl H", Decimal = "8", Binary = "00001000", Hex = "08"},
new Columns {CharacterName = "Horizontal Tab", Char = "TAB", Code = "Ctrl I", Decimal = "9", Binary = "00001001", Hex = "09"},
new Columns {CharacterName = "Line Feed", Char = "LF", Code = "Ctrl J", Decimal = "10", Binary = "00001010", Hex = "0A"},
new Columns {CharacterName = "Vertical Tab", Char = "VT", Code = "Ctrl K", Decimal = "11", Binary = "00001011", Hex = "0B"},
new Columns {CharacterName = "Form Feed", Char = "FF", Code = "Ctrl L", Decimal = "12", Binary = "00001100", Hex = "0C"},
new Columns {CharacterName = "Carriage Return", Char = "CR", Code = "Ctrl M", Decimal = "13", Binary = "00001101", Hex = "0D"},
new Columns {CharacterName = "Shift Out", Char = "SO", Code = "Ctrl N", Decimal = "14", Binary = "00001110", Hex = "0E"},
new Columns {CharacterName = "Shift In", Char = "SI", Code = "Ctrl O", Decimal = "15", Binary = "00001111", Hex = "0F"},
new Columns {CharacterName = "Data Line Escape", Char = "DLE", Code = "Ctrl P", Decimal = "16", Binary = "00010000", Hex = "10"},
new Columns {CharacterName = "Device Control 1", Char = "DC1", Code = "Ctrl Q", Decimal = "17", Binary = "00010001", Hex = "11"},
new Columns {CharacterName = "Device Control 2", Char = "DC2", Code = "Ctrl R", Decimal = "18", Binary = "00010010", Hex = "12"},
new Columns {CharacterName = "Device Control 3", Char = "DC3", Code = "Ctrl S", Decimal = "19", Binary = "00010011", Hex = "13"},
new Columns {CharacterName = "Device Control 4", Char = "DC4", Code = "Ctrl T", Decimal = "20", Binary = "00010100", Hex = "14"},
new Columns {CharacterName = "Negative Acknowledge", Char = "NAK", Code = "Ctrl U", Decimal = "21", Binary = "00010101", Hex = "15"},
new Columns {CharacterName = "Synchronous Idle", Char = "SYN", Code = "Ctrl V", Decimal = "22", Binary = "00010110", Hex = "16"},
new Columns {CharacterName = "End of Transmit Block", Char = "ETB", Code = "Ctrl W", Decimal = "23", Binary = "00010111", Hex = "17"},
new Columns {CharacterName = "Cancel", Char = "CAN", Code = "Ctrl X", Decimal = "24", Binary = "00011000", Hex = "18"},
new Columns {CharacterName = "End of Medium", Char = "EM", Code = "Ctrl Y", Decimal = "25", Binary = "00011001", Hex = "19"},
new Columns {CharacterName = "Substitute", Char = "SUB", Code = "Ctrl Z", Decimal = "26", Binary = "00011010", Hex = "1A"},
new Columns {CharacterName = "Escape", Char = "ESC", Code = "Ctrl [", Decimal = "27", Binary = "00011011", Hex = "1B"},
new Columns {CharacterName = "File Separator", Char = "FS", Code = "Ctrl \\", Decimal = "28", Binary = "00011100", Hex = "1C"},
new Columns {CharacterName = "Group Separator", Char = "GS", Code = "Ctrl ]", Decimal = "29", Binary = "00011101", Hex = "1D"},
new Columns {CharacterName = "Record Separator", Char = "RS", Code = "Ctrl ^", Decimal = "30", Binary = "00011110", Hex = "1E"},
new Columns {CharacterName = "Unit Separator", Char = "US", Code = "Ctrl _", Decimal = "31", Binary = "00011111", Hex = "1F"},
new Columns {CharacterName = "Space", Char = " ", Code = " ", Decimal = "32", Binary = "00100000 ", Hex = "20"},
new Columns {CharacterName = "Exclamation Point", Char = "!", Code = "Shift 1", Decimal = "33", Binary = "00100001 ", Hex = "21"},
new Columns {CharacterName = "Double Quote", Char = "\"", Code = "Shift ‘", Decimal = "34", Binary = "00100010 ", Hex = "22"},
new Columns {CharacterName = "Pound/Number Sign", Char = "#", Code = "Shift 3", Decimal = "35", Binary = "00100011 ", Hex = "23"},
new Columns {CharacterName = "Dollar Sign", Char = "$", Code = "Shift 4", Decimal = "36", Binary = "00100100 ", Hex = "24"},
new Columns {CharacterName = "Percent Sign", Char = "%", Code = "Shift 5", Decimal = "37", Binary = "00100101 ", Hex = "25"},
new Columns {CharacterName = "Ampersand", Char = "&", Code = "Shift 7", Decimal = "38", Binary = "00100110 ", Hex = "26"},
new Columns {CharacterName = "Single Quote", Char = "‘", Code = "‘", Decimal = "39", Binary = "00100111 ", Hex = "27"},
new Columns {CharacterName = "Left Parenthesis", Char = "(", Code = "Shift 9", Decimal = "40", Binary = "00101000 ", Hex = "28"},
new Columns {CharacterName = "Right Parenthesis", Char = ")", Code = "Shift 0", Decimal = "41", Binary = "00101001 ", Hex = "29"},
new Columns {CharacterName = "Asterisk", Char = "*", Code = "Shift 8", Decimal = "42", Binary = "00101010 ", Hex = "2A"},
new Columns {CharacterName = "Plus Sign", Char = "+", Code = "Shift =", Decimal = "43", Binary = "00101011 ", Hex = "2B"},
new Columns {CharacterName = "Comma", Char = ",", Code = ",", Decimal = "44", Binary = "00101100 ", Hex = "2C"},
new Columns {CharacterName = "Hyphen / Minus Sign", Char = "-", Code = "-", Decimal = "45", Binary = "00101101 ", Hex = "2D"},
new Columns {CharacterName = "Period", Char = ".", Code = ".", Decimal = "46", Binary = "00101110 ", Hex = "2E"},
new Columns {CharacterName = "Forward Slash", Char = "/", Code = "/", Decimal = "47", Binary = "00101111 ", Hex = "2F"},
new Columns {CharacterName = "Zero Digit", Char = "0", Code = "0", Decimal = "48", Binary = "00110000 ", Hex = "30"},
new Columns {CharacterName = "One Digit", Char = "1", Code = "1", Decimal = "49", Binary = "00110001 ", Hex = "31"},
new Columns {CharacterName = "Two Digit", Char = "2", Code = "2", Decimal = "50", Binary = "00110010 ", Hex = "32"},
new Columns {CharacterName = "Three Digit", Char = "3", Code = "3", Decimal = "51", Binary = "00110011 ", Hex = "33"},
new Columns {CharacterName = "Four Digit", Char = "4", Code = "4", Decimal = "52", Binary = "00110100 ", Hex = "34"},
new Columns {CharacterName = "Five Digit", Char = "5", Code = "5", Decimal = "53", Binary = "00110101 ", Hex = "35"},
new Columns {CharacterName = "Six Digit", Char = "6", Code = "6", Decimal = "54", Binary = "00110110 ", Hex = "36"},
new Columns {CharacterName = "Seven Digit", Char = "7", Code = "7", Decimal = "55", Binary = "00110111 ", Hex = "37"},
new Columns {CharacterName = "Eight Digit", Char = "8", Code = "8", Decimal = "56", Binary = "00111000 ", Hex = "38"},
new Columns {CharacterName = "Nine Digit", Char = "9", Code = "9", Decimal = "57", Binary = "00111001 ", Hex = "39"},
new Columns {CharacterName = "Colon", Char = ":", Code = "Shift ;", Decimal = "58", Binary = "00111010 ", Hex = "3A"},
new Columns {CharacterName = "Semicolon", Char = ";", Code = ";", Decimal = "59", Binary = "00111011 ", Hex = "3B"},
new Columns {CharacterName = "Less-Than Sign", Char = "<", Code = "Shift ,", Decimal = "60", Binary = "00111100 ", Hex = "3C"},
new Columns {CharacterName = "Equals Sign", Char = "=", Code = "=", Decimal = "61", Binary = "00111101 ", Hex = "3D"},
new Columns {CharacterName = "Greater-Than Sign", Char = ">", Code = "Shift .", Decimal = "62", Binary = "00111110 ", Hex = "3E"},
new Columns {CharacterName = "Question Mark", Char = "?", Code = "Shift /", Decimal = "63", Binary = "00111111 ", Hex = "3F"},
new Columns {CharacterName = "At Sign", Char = "@", Code = "Shift 2", Decimal = "64", Binary = "01000000 ", Hex = "40"},
new Columns {CharacterName = "Capital A", Char = "A", Code = "Shift A", Decimal = "65", Binary = "01000001 ", Hex = "41"},
new Columns {CharacterName = "Capital B", Char = "B", Code = "Shift B", Decimal = "66", Binary = "01000010 ", Hex = "42"},
new Columns {CharacterName = "Capital C", Char = "C", Code = "Shift C", Decimal = "67", Binary = "01000011 ", Hex = "43"},
new Columns {CharacterName = "Capital D", Char = "D", Code = "Shift D", Decimal = "68", Binary = "01000100 ", Hex = "44"},
new Columns {CharacterName = "Capital E", Char = "E", Code = "Shift E", Decimal = "69", Binary = "01000101 ", Hex = "45"},
new Columns {CharacterName = "Capital F", Char = "F", Code = "Shift F", Decimal = "70", Binary = "01000110 ", Hex = "46"},
new Columns {CharacterName = "Capital G", Char = "G", Code = "Shift G", Decimal = "71", Binary = "01000111 ", Hex = "47"},
new Columns {CharacterName = "Capital H", Char = "H", Code = "Shift H", Decimal = "72", Binary = "01001000 ", Hex = "48"},
new Columns {CharacterName = "Capital I", Char = "I", Code = "Shift I", Decimal = "73", Binary = "01001001 ", Hex = "49"},
new Columns {CharacterName = "Capital J", Char = "J", Code = "Shift J", Decimal = "74", Binary = "01001010 ", Hex = "4A"},
new Columns {CharacterName = "Capital K", Char = "K", Code = "Shift K", Decimal = "75", Binary = "01001011 ", Hex = "4B"},
new Columns {CharacterName = "Capital L", Char = "L", Code = "Shift L", Decimal = "76", Binary = "01001100 ", Hex = "4C"},
new Columns {CharacterName = "Capital M", Char = "M", Code = "Shift M", Decimal = "77", Binary = "01001101 ", Hex = "4D"},
new Columns {CharacterName = "Capital N", Char = "N", Code = "Shift N", Decimal = "78", Binary = "01001110 ", Hex = "4E"},
new Columns {CharacterName = "Capital O", Char = "O", Code = "Shift O", Decimal = "79", Binary = "01001111 ", Hex = "4F"},
new Columns {CharacterName = "Capital P", Char = "P", Code = "Shift P", Decimal = "80", Binary = "01010000 ", Hex = "50"},
new Columns {CharacterName = "Capital Q", Char = "Q", Code = "Shift Q", Decimal = "81", Binary = "01010001 ", Hex = "51"},
new Columns {CharacterName = "Capital R", Char = "R", Code = "Shift R", Decimal = "82", Binary = "01010010 ", Hex = "52"},
new Columns {CharacterName = "Capital S", Char = "S", Code = "Shift S", Decimal = "83", Binary = "01010011 ", Hex = "53"},
new Columns {CharacterName = "Capital T", Char = "T", Code = "Shift T", Decimal = "84", Binary = "01010100 ", Hex = "54"},
new Columns {CharacterName = "Capital U", Char = "U", Code = "Shift U", Decimal = "85", Binary = "01010101 ", Hex = "55"},
new Columns {CharacterName = "Capital V", Char = "V", Code = "Shift V", Decimal = "86", Binary = "01010110 ", Hex = "56"},
new Columns {CharacterName = "Capital W", Char = "W", Code = "Shift W", Decimal = "87", Binary = "01010111 ", Hex = "57"},
new Columns {CharacterName = "Capital X", Char = "X", Code = "Shift X", Decimal = "88", Binary = "01011000 ", Hex = "58"},
new Columns {CharacterName = "Capital Y", Char = "Y", Code = "Shift Y", Decimal = "89", Binary = "01011001 ", Hex = "59"},
new Columns {CharacterName = "Capital Z", Char = "Z", Code = "Shift Z", Decimal = "90", Binary = "01011010 ", Hex = "5A"},
new Columns {CharacterName = "Left Bracket", Char = "[", Code = "[", Decimal = "91", Binary = "01011011 ", Hex = "5B"},
new Columns {CharacterName = "Backward Slash", Char = "\\", Code = "\\", Decimal = "92", Binary = "01011100 ", Hex = "5C"},
new Columns {CharacterName = "Right Bracket", Char = "]", Code = "]", Decimal = "93", Binary = "01011101 ", Hex = "5D"},
new Columns {CharacterName = "Caret", Char = "^", Code = "Shift 6", Decimal = "94", Binary = "01011110 ", Hex = "5E"},
new Columns {CharacterName = "Underscore", Char = "_", Code = "Shift -", Decimal = "95", Binary = "01011111 ", Hex = "5F"},
new Columns {CharacterName = "Back Quote", Char = "`", Code = "`", Decimal = "96", Binary = "01100000 ", Hex = "60"},
new Columns {CharacterName = "Lower-case A", Char = "a", Code = "A", Decimal = "97", Binary = "01100001 ", Hex = "61"},
new Columns {CharacterName = "Lower-case B", Char = "b", Code = "B", Decimal = "98", Binary = "01100010 ", Hex = "62"},
new Columns {CharacterName = "Lower-case C", Char = "c", Code = "C", Decimal = "99", Binary = "01100011 ", Hex = "63"},
new Columns {CharacterName = "Lower-case D", Char = "d", Code = "D", Decimal = "100", Binary = "01100100 ", Hex = "64"},
new Columns {CharacterName = "Lower-case E", Char = "e", Code = "E", Decimal = "101", Binary = "01100101 ", Hex = "65"},
new Columns {CharacterName = "Lower-case F", Char = "f", Code = "F", Decimal = "102", Binary = "01100110 ", Hex = "66"},
new Columns {CharacterName = "Lower-case G", Char = "g", Code = "G", Decimal = "103", Binary = "01100111 ", Hex = "67"},
new Columns {CharacterName = "Lower-case H", Char = "h", Code = "H", Decimal = "104", Binary = "01101000 ", Hex = "68"},
new Columns {CharacterName = "Lower-case I", Char = "I", Code = "I", Decimal = "105", Binary = "01101001 ", Hex = "69"},
new Columns {CharacterName = "Lower-case J", Char = "j", Code = "J", Decimal = "106", Binary = "01101010 ", Hex = "6A"},
new Columns {CharacterName = "Lower-case K", Char = "k", Code = "K", Decimal = "107", Binary = "01101011 ", Hex = "6B"},
new Columns {CharacterName = "Lower-case L", Char = "l", Code = "L", Decimal = "108", Binary = "01101100 ", Hex = "6C"},
new Columns {CharacterName = "Lower-case M", Char = "m", Code = "M", Decimal = "109", Binary = "01101101 ", Hex = "6D"},
new Columns {CharacterName = "Lower-case N", Char = "n", Code = "N", Decimal = "110", Binary = "01101110 ", Hex = "6E"},
new Columns {CharacterName = "Lower-case O", Char = "o", Code = "O", Decimal = "111", Binary = "01101111 ", Hex = "6F"},
new Columns {CharacterName = "Lower-case P", Char = "p", Code = "P", Decimal = "112", Binary = "01110000 ", Hex = "70"},
new Columns {CharacterName = "Lower-case Q", Char = "q", Code = "Q", Decimal = "113", Binary = "01110001 ", Hex = "71"},
new Columns {CharacterName = "Lower-case R", Char = "r", Code = "R", Decimal = "114", Binary = "01110010 ", Hex = "72"},
new Columns {CharacterName = "Lower-case S", Char = "s", Code = "S", Decimal = "115", Binary = "01110011 ", Hex = "73"},
new Columns {CharacterName = "Lower-case T", Char = "t", Code = "T", Decimal = "116", Binary = "01110100 ", Hex = "74"},
new Columns {CharacterName = "Lower-case U", Char = "u", Code = "U", Decimal = "117", Binary = "01110101 ", Hex = "75"},
new Columns {CharacterName = "Lower-case V", Char = "v", Code = "V", Decimal = "118", Binary = "01110110 ", Hex = "76"},
new Columns {CharacterName = "Lower-case W", Char = "w", Code = "W", Decimal = "119", Binary = "01110111 ", Hex = "77"},
new Columns {CharacterName = "Lower-case X", Char = "x", Code = "X", Decimal = "120", Binary = "01111000 ", Hex = "78"},
new Columns {CharacterName = "Lower-case Y", Char = "y", Code = "Y", Decimal = "121", Binary = "01111001 ", Hex = "79"},
new Columns {CharacterName = "Lower-case Z", Char = "z", Code = "Z", Decimal = "122", Binary = "01111010 ", Hex = "7A"},
new Columns {CharacterName = "Left Brace", Char = "{", Code = "Shift [", Decimal = "123", Binary = "01111011 ", Hex = "7B"},
new Columns {CharacterName = "Vertical Bar", Char = "|", Code = "Shift \\", Decimal = "124", Binary = "01111100 ", Hex = "7C"},
new Columns {CharacterName = "Right Brace", Char = "}", Code = "Shift ]", Decimal = "125", Binary = "01111101 ", Hex = "7D"},
new Columns {CharacterName = "Tilde", Char = "~", Code = "Shift `", Decimal = "126", Binary = "01111110 ", Hex = "7E"},
new Columns {CharacterName = "Delta", Char = "D ", Code = " ", Decimal = "127", Binary = "01111111 ", Hex = "7F"},
};
return ASCII_Code_List;
}
}
Comments
Post a Comment