代码如下
string str = "Hello World";
byte[] bytes = Encoding.UTF8.GetBytes(str);
Console.WriteLine("字节数组:");
foreach (byte b in bytes)
{
Console.Write(b + " ");
}代码如下
string str = "Hello World";
byte[] bytes = Encoding.UTF8.GetBytes(str);
Console.WriteLine("字节数组:");
foreach (byte b in bytes)
{
Console.Write(b + " ");
}