且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在C#.net中将字节转换为字符串

更新时间:2023-11-14 09:59:28

System.Text.Encoding enc = System.Text.Encoding.ASCII;
string myString = enc.GetString(myByteArray )


尝试使用

Try with the

byte [] dBytes = string str;
System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
str = enc.GetString(dBytes);