Encoding类 表示字符编码 1.字符串转换成字节数组byte[] using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FileStreamTest { class Program { static void Main(string[] args) {…
using System; using System.Collections.Generic; using System.Text; namespace NET.MST.Fourth.StringByte { class StringByte { static void Main(string[] args) { String s = "我是字符串,I am string"; //字节数组转换到字符串 Byte[] utf8 = StringToByte(s, Encoding.UTF…