c# 键盘接口的磁条读卡器

 
private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                this.textBox1.Focus();
                this.label9.Text = "sss";
                String linshi = this.textBox1.Text;
                linshi = linshi.TrimStart(';');
                linshi = linshi.TrimEnd('?');

                this.textBox1.Text = linshi;
                this.textBox1.SelectAll();



                HUIYUAN.Model.Card mc = new HUIYUAN.Model.Card();
                try
                {
                    mc = new HUIYUAN.BLL.Card().GetModelList("cardid='" + this.textBox1.Text + "'")[0];
                }
                catch
                {
                    MessageBox.Show("没有这个卡号");
                    return;
                }


                this.mc = mc;
                this.groupBox1.Visible = false;
                this.gblevel.Visible = false;
                this.gbchuzhi.Visible = false;
                formbind();
               
            }

        }
    }


你可能感兴趣的:(object,String,C#,textbox)