zoukankan      html  css  js  c++  java
  • ASCII码对照表

    1、字母转换成ASCII码

    复制代码
     1             string str = "hello";
     2             byte[] array = new byte[1];  
     3             array = System.Text.Encoding.ASCII.GetBytes(str); //把str的每个字符转换成ascii码
     4 
     5             int asciicode1 = (short)(array[0]);//h 的ascii码
     6             int asciicode2 = (short)(array[1]);//e 的ascii码
     7             int asciicode3 = (short)(array[2]);//l 的ascii码
     8             int asciicode4 = (short)(array[3]);//l 的ascii码
     9             int asciicode5 = (short)(array[4]);//o 的ascii码
    10 
    11             int asciicode = 0;
    12             for (int i = 0; i < array.Length; i++)
    13             {
    14                 asciicode += array[i];//str 的ascii码
    15             }
    复制代码

    2、ASCII码换成字母

    1 byte[] array = new byte[1];
    2 array[0] = (byte)(Convert.ToInt32(104));//ASCII码强制转换二进制
    3 string ret=Convert.ToString(System.Text.Encoding.ASCII.GetString(array));

    3、ASCII码对照表

  • 相关阅读:
    Linux
    Python
    Linux
    Python
    爬虫
    WEB
    法正(13):密谋
    法正(12):张松
    法正(11):入川
    法正(10):袍哥
  • 原文地址:https://www.cnblogs.com/sdxlz666/p/11009541.html
Copyright © 2011-2022 走看看