我有一个程序,其中用户在阅读器上点击 RFID 卡,程序将输入此数据。在这个程序中,有一个提示,我必须单击确定。RFID 卡被点击后,如何移除 OK 按钮并使其成为自动 OK 程序?
以下是程序的各个部分:
委托无效函数();
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 (_parentForm == "StandBy")
{
Utils.CurrentCustomer.CustomerInfo = customer;
frmStandBy form = (frmStandBy)this.Owner;
form.xResult = "OK";
}
this.Close();
}