Example #1
0
        /// <summary>
        /// 中文汉字
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnChinese_Click(object sender, EventArgs e)
        {
            string strValue  = this.cboxChinese.SelectedItem as string;
            bool   checkFlag = false;

            switch (strValue)
            {
            case "中文汉字":
                checkFlag = ValidHelper.ChsIsChinese(this.txtChinese.Text);
                break;

            case "中字母数":
                checkFlag = ValidHelper.ChsIsChineseOrEngOrNum(this.txtChinese.Text);
                break;

            case "真实姓名":
                checkFlag = ValidHelper.ChsIsTname(this.txtChinese.Text);
                break;

            case "半角转换":
                this.lblResultChinese.Text = string.Format(" {0}", ValidHelper.ChsToDBC(this.txtChinese.Text));
                break;

            default:
                break;
            }
            this.lblResultChinese.Text = checkFlag.ToString();
        }