zoukankan      html  css  js  c++  java
  • C#中如何将字符串转换byte[],同时如何将byte[]换成字符串

    1 string to byte   []­

    string str = "abcd"   ; ­

    byte[] bytes = System.Text.Encoding.ASCII.GetBytes(str);   ­

    -------------------------------------------------------------------------------------------------------------­

    2 byte[]   to string ­

    byte[] bytes = new byte[255] ;   ­

    string str = System.Text.Encoding.ASCII.GetString(bytes,0,bytes.Length);   ­
    ------------------------------------------------------------------------------------------------------------

    3. byte to string­

    byte a=4;­

    string str=a.toString();­

  • 相关阅读:
    截取
    逃避系统警察
    刷题
    排队
    侦察兵
    朋友
    楼层
    解码
    倒水
    魔法阵
  • 原文地址:https://www.cnblogs.com/Zoya/p/1553503.html
Copyright © 2011-2022 走看看