c#设置只能扫描枪

        DateTime dt = new DateTime();
        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((DateTime.Now - dt).Milliseconds > 100) {
                textBox1.Text = "";
            }
            dt = DateTime.Now;
        }

 

posted @ 2021-07-12 18:54  masha2017  阅读(108)  评论(0编辑  收藏  举报