string转Byte[]
string str = "Hello World";
byte[] byteArray = Encoding.UTF8.GetBytes(str);
Byte[]转string
string str = "Hello world!";
byte[] bytes = Encoding.UTF8.GetBytes(str);
string result = Encoding.UTF8.GetString(bytes);
string str = "Hello World";
byte[] byteArray = Encoding.UTF8.GetBytes(str);
string str = "Hello world!";
byte[] bytes = Encoding.UTF8.GetBytes(str);
string result = Encoding.UTF8.GetString(bytes);