中文字符的长度
string strTmp = "中国";
int a = System.Text.Encoding.Default.GetBytes(strTmp).Length;
int b = strTmp.Length;
Console.WriteLine(a); // 4
Console.WriteLine(b); // 2
string strTmp = "中国";
int a = System.Text.Encoding.Default.GetBytes(strTmp).Length;
int b = strTmp.Length;
Console.WriteLine(a); // 4
Console.WriteLine(b); // 2