您现在的位置: 魅力都匀 >> 电脑教程 >> C#学习笔记 >> 正文
C#中获取汉字的拼音类完整代码
作者:蔡老师  文章来源:本站原创 点击数: 更新时间:2008-6-10 【字体:

  先声明一点,这个类可不是我写的,呵呵!在网上找了几个转化汉字为拼音的类,还是这个比较好用!

  直接复制代码到C#中即可使用!  

 public class ChinesePY
        {
            #region private
            static Hashtable ht = null;
            static Hashtable Ht
            {
                get
                {
                    if (ht == null)
                    {
                        ht = new Hashtable();
                        ht.Add(-20319, "a");
                        ht.Add(-20317, "ai"); ht.Add(-20304, "an"); ht.Add(-20295, "ang");
                        ht.Add(-20292, "ao"); ht.Add(-20283, "ba"); ht.Add(-20265, "bai");
                        ht.Add(-20257, "ban"); ht.Add(-20242, "bang"); ht.Add(-20230, "bao");
                        ht.Add(-20051, "bei"); ht.Add(-20036, "ben"); ht.Add(-20032, "beng");
                        ht.Add(-20026, "bi"); ht.Add(-20002, "bian"); ht.Add(-19990, "biao");
                        ht.Add(-19986, "bie"); ht.Add(-19982, "bin"); ht.Add(-19976, "bing");
                        ht.Add(-19805, "bo"); ht.Add(-19784, "bu"); ht.Add(-19775, "ca");
                        ht.Add(-19774, "cai"); ht.Add(-19763, "can"); ht.Add(-19756, "cang");
                        ht.Add(-19751, "cao"); ht.Add(-19746, "ce"); ht.Add(-19741, "ceng");
                        ht.Add(-19739, "cha"); ht.Add(-19728, "chai"); ht.Add(-19725, "chan");
                        ht.Add(-19715, "chang"); ht.Add(-19540, "chao"); ht.Add(-19531, "che");
                        ht.Add(-19525, "chen"); ht.Add(-19515, "cheng"); ht.Add(-19500, "chi");
                        ht.Add(-19484, "chong"); ht.Add(-19479, "chou"); ht.Add(-19467, "chu");
                        ht.Add(-19289, "chuai"); ht.Add(-19288, "chuan"); ht.Add(-19281, "chuang");
                        ht.Add(-19275, "chui"); ht.Add(-19270, "chun"); ht.Add(-19263, "chuo");
                        ht.Add(-19261, "ci"); ht.Add(-19249, "cong"); ht.Add(-19243, "cou");
                        ht.Add(-19242, "cu"); ht.Add(-19238, "cuan"); ht.Add(-19235, "cui");
                        ht.Add(-19227, "cun"); ht.Add(-19224, "cuo"); ht.Add(-19218, "da");
                        ht.Add(-19212, "dai"); ht.Add(-19038, "dan"); ht.Add(-19023, "dang");
                        ht.Add(-19018, "dao"); ht.Add(-19006, "de"); ht.Add(-19003, "deng");
                        ht.Add(-18996, "di"); ht.Add(-18977, "dian"); ht.Add(-18961, "diao");
                        ht.Add(-18952, "die"); ht.Add(-18783, "ding"); ht.Add(-18774, "diu");

[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页

关于〖C#中获取汉字的拼音类完整代码〗的最新评论:
| 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 |
黔ICP备06001794号