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()); }
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; } }
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(); }
private void txtArea_TextChanged(object sender, EventArgs e) { string str = EcanConvertToCh.convertCh(txtArea.Text.Trim()); txtPinyin.Text = str; }
private void txtYHXM_TextChanged(object sender, EventArgs e) { string str = EcanConvertToCh.convertCh(txtYHXM.Text.Trim()); txtYHXMJP.Text = str; }