string与byte[]相互转换:
1.STRING转BYTE[]
byte[] strByte = System.Text.Encoding.ASCII.GetBytes(字符串);
2.byte[]转string
string strvalue = System.Text.Encoding.ASCII.GetString(字节数组,开始位置,字节长度);
Powered by: 博客园 Copyright © 2024 SEA虎 Powered by .NET 9.0 on Kubernetes