1、字符串转byte[]
string str=“字符串转byte[]”;
byte[] bytes=System.Text.Encoding.ASCII.GetBytes(str);
2、byte[]转字符串
byte[] bytes = new byte[255] ;
string str = System.Text.Encoding.ASCII.GetString(bytes,0,bytes.Length);
C#中如何将字符串转换成byte[],如何将byte[]转换成字符串?
最新推荐文章于 2023-11-17 10:31:18 发布