Пример #1
0
        private void txtName_TextChanged(object sender, EventArgs e)
        {
            string str = EcanConvertToCh.convertCh(txtName.Text.Trim());

            txtPinyin.Text = str;
            //Code.Services.PinyinService service = new Code.Services.PinyinService();
            //txtPinyin.Text = service.GetChineseToPinyin(txtName.Text.Trim());
        }
Пример #2
0
        private void cbbUnit_TextChanged(object sender, EventArgs e)
        {
            var model = DepartmentSource.FirstOrDefault(x => x.Department == cbbUnit.Text.Trim());

            if (model == null)
            {
                string str = EcanConvertToCh.convertCh(cbbUnit.Text.Trim());
                txtUnitPY.Text = str;
            }
            else
            {
                txtUnitPY.Text = model.Pinyin;
            }
        }
Пример #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("欢迎使用中文转拼音系统\n==========================");
            while (true)
            {
                Console.WriteLine("\n请输入一个中文字符串:");
                string input = Console.ReadLine();

                EcanConvertToCh ec      = new EcanConvertToCh();
                string          pingyin = ec.convertCh(input);
                Console.WriteLine("\n拼音:" + pingyin);

                Console.WriteLine("\n拼音首字母:" + PinYin.GetCodstring(input));
            }
            Console.ReadKey();
        }
Пример #4
0
        private void txtArea_TextChanged(object sender, EventArgs e)
        {
            string str = EcanConvertToCh.convertCh(txtArea.Text.Trim());

            txtPinyin.Text = str;
        }
Пример #5
0
        private void txtYHXM_TextChanged(object sender, EventArgs e)
        {
            string str = EcanConvertToCh.convertCh(txtYHXM.Text.Trim());

            txtYHXMJP.Text = str;
        }