Looking at 9CBS, I didn't find a complete conversion function. It was organized on the basis of the former. It is possible to use it. Thank Bugfree (eight flying). /// /// Chinese character turning pighary abrasion /// Code by museestudio@hotmail.com /// 2004-11-30 /// summary> /// Converted Chinese character string param> /// Pinyin abbreviation returns> public string getPystring (String str) {string tempstr = "; Foreach (Char C in Str) {if ((int) c> = 33 && (int) c <= 126) {// letter and symbols to retain TEMPSTR = c.toString ();} else {// Accumulate Pinyin Shengmu Tempstr = getpychar (c.toString ());}} Return Tempstr;} /// /// Take a single character Pinyin Shengmu /// Code by MuseStudio@hotmail.com /// 2004-11-30 /// summary> /// Single Chinese characters to be converted param> /// Pinyin sound returns> public string getpychar (string c) {byte [] array = new byte [2]; array = system.text .Encoding.default.getbytes (c ); INT i = (short) (Array [0] - '/ 0') * 256 ((short) (Array [1] - '/ 0');
IF (i <0xB0A1) Return "*"; if (i <0xB0C5) Return "a"; if (i <0xB2C1) Return "B"; if (i <0xB4ee) Return "C"; IF (i <0xB6ea) Return "D"; IF (i <0xB7A2) Return "E"; if (i <0xB8C1) Return "F"; if (i <0xB9fe) Return "G"; if (i <0xbbf7) return "h"; if (i <0xBFA6) Return "J"; if (i <0xc0ac) Return "K"; if (i <0xc2e8) Return "L"; if (i <0xc4c3) Return "M"; if (i <0xc5b6) Return "n"; if (i <0xc5be) return "O"; if (i <0xc6da) return "p"; if (i <0xc8bb) return "q"; if (i <0xc8f6) return "r"; IF ( I <0XCBFA) Return "S"; if (i <0xcdda) Return "T"; if (i <0xCEF4) Return "W"; if (i <0xD1b9) return "x"; if (i <0xd4d1) return y "; if (i <0xD7fa) return" z "; return" * ";