色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

byte數(shù)組和string的區(qū)別

黃文隆2年前13瀏覽0評論

byte數(shù)組和string的區(qū)別?

byte[]轉(zhuǎn)換為字符串存儲,然后再轉(zhuǎn)回來

byte[] bytes = System.Text.Encoding.Default.GetBytes("fadfasfasdf");

string str = BitConverter.ToString(bytes);

string s2 = BitConverter.ToString(bytes); // 82-C8-EA-17

String[] tempAry = s2.Split('-');

byte[] decBytes2 = new byte[tempAry.Length];

for (int i = 0; i < tempAry.Length; i++)

decBytes2[i] = Convert.ToByte(tempAry[i], 16);

// decBytes2 same as bytes

string s3 = Convert.ToBase64String(bytes); // gsjqFw==

byte[] decByte3 = Convert.FromBase64String(s3);

java字符串字節(jié)數(shù)組,byte數(shù)組和string的區(qū)別