int t1 = convert.toint32(s1,16); int t2 = convert.toint32(s2,16);
array[0] = (byte)t1; array[1] = (byte)t2;
string s = system.text.encoding.unicode.getstring(array);
//default方式反解码为汉字 array[0] = (byte)196; array[1] = (byte)207; s = system.text.encoding.default.getstring(array);
//取字符串长度 s = "iam方枪枪"; int len = s.length;//will output as 6 byte[] sarr = system.text.encoding.default.getbytes(s); len = sarr.length;//will output as 3+3*2=9