/// <Summary>
/// Convert Chinese characters into pinyin (full spelling)
/// </Summary>
/// <Param name = "hzString"> Chinese character string </param>
/// <Returns> converted pinyin (full spelling) string study.pctoday.net.cn </returns>
Public static string ConvertE (string hzString)
{
// Match Chinese Characters
Regex regex = new Regex ("^ [u4e00-u9fa5] $ ");
Byte [] array = new byte [2];
String pyString = "";
Int chrAsc = 0;
Int i1 = 0;
Int i2 = 0;
Char [] noWChar = hzString. ToCharArray ();
For (int j = 0; j <noWChar. Length; j ++)
{
// Chinese Characters
If (regex. IsMatch (noWChar [j]. ToString ()))
{
Array = System. Text. Encoding. Default. GetBytes (noWChar [j]. ToString ());
I1 = (short) (array [0]);
I2 = (short) (array [1]);
ChrAsc = i1 * 256 + i2-65536;
If (chrAsc> 0 & chrAsc <160)
{
PyString + = noWChar [j];
}
Else
{
// Modify some text
If (chrAsc =-9254) // corrected the word "success ".
PyString + = "Zhen ";
Else
{
For (int I = (pyValue. Length-1); I> = 0; I --)
{
If (pyValue [I] <= chrAsc)
{
PyString + = pyName [I];
Break;
}
}
}
}
}
// Non-Chinese Characters
Else
{
PyString + = noWChar [j]. ToString ();
}
}
Return pyString;
}
# Region converts Chinese characters into pinyin
Private static int [] pyValue = new int []
{
-