小编Kae*_*ael的帖子

C#如何自动从RFID扫描中恢复?

我有一个程序,其中用户在阅读器上轻敲RFID卡,程序将输入该数据.在这个程序中,有一个提示,我必须单击确定.轻敲RFID卡后,如何取下确定按钮并将其设为自动确认程序?

以下是该计划的部分内容:

委托void Function();

    private void serialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e)
    {
        string sdsd = serialPort1.ReadLine();
        string Hexed = new LasalleRFIDComputerRentals.BLL.DAL.Utils().HexIt(sdsd);

        SetRFIDText(Hexed);
    }


    protected void SetRFIDText(string input)
    {
        this.Invoke(new Function(delegate()
        {
            txtRFID.Text = input;
        }));

        CustomerInfo customer = new Customer().GetCustomerByRFID(txtRFID.Text);


    }

    private void btnOk_Click(object sender, EventArgs e)
    {
        if (txtRFID.Text.Trim() == "")
        {
            MessageBox.Show(this, "Please supply the RFID.", "RFID Reader", MessageBoxButtons.OK);

            txtRFID.Focus();
            return;
        }

        CustomerInfo customer = new Customer().GetCustomerByRFID(txtRFID.Text);

        if (customer.CustomerID <= 0)
        {
            MessageBox.Show("Invalid RFID", "Validation");

            this.Close();
            return;
        }


        if …
Run Code Online (Sandbox Code Playgroud)

c# button rfid

5
推荐指数
1
解决办法
1158
查看次数

标签 统计

button ×1

c# ×1

rfid ×1