public static string GetOneIndexPinYin(string text)
{
char pinyin;
byte[] array;
System.Text.StringBuilder sb = new System.Text.StringBuilder(text.Length);
foreach (char c in text)
{
pinyin = c;
array = System.Text.Encoding.Default.GetBytes(new char[] { c });
if (array.Length == 2)
{
int i = array[0] * 0x100 + array[1];
if (i < 0xB0A1) pinyin = 'V'; //c;
else
if (i < 0xB0C5) pinyin = 'A';
else
if (i < 0xB2C1) pinyin = 'B';
else
if (i < 0xB4EE) pinyin = 'C';
else
if (i < 0xB6EA) pinyin = 'D';
else
if (i < 0xB7A2) pinyin = 'E';
else
if (i < 0xB8C1) pinyin = 'F';
else
if (i < 0xB9FE) pinyin = 'G';
else
if (i < 0xBBF7) pinyin = 'H';
else
if (i < 0xBFA6) pinyin = 'J';
else
if (i < 0xC0AC) pinyin = 'K';
else
if (i < 0xC2E8) pinyin = 'L';
else
if (i < 0xC4C3) pinyin = 'M';
else
if (i < 0xC5B6) pinyin = 'N';
else
if (i < 0xC5BE) pinyin = 'O';
else
if (i < 0xC6DA) pinyin = 'P';
else
if (i < 0xC8BB) pinyin = 'Q';
else
if (i < 0xC8F6) pinyin = 'R';
else
if (i < 0xCBFA) pinyin = 'S';
else
if (i < 0xCDDA) pinyin = 'T';
else
if (i < 0xCEF4) pinyin = 'W';
else
if (i < 0xD1B9) pinyin = 'X';
else
if (i < 0xD4D1) pinyin = 'Y';
else
if (i < 0xD7FA) pinyin = 'Z';
else
pinyin = 'V';
}
else
pinyin = char.ToUpper(pinyin);
sb.Append(pinyin);
}
return sb.ToString();
}