private void btnSecLock_Click(object sender, EventArgs e) { byte membank; byte pwdLevel; int status = 0; byte[] value = new byte[16]; string s = ""; if (tEpcAccess.TextLength != 8) { lInfo.Items.Add("Access Password length not enough"); return; } uint unAccPwd; switch (cEpcMembank.SelectedIndex) { case 0: membank = 3; break; case 1: membank = 2; break; case 2: membank = 1; break; case 3: membank = 0; break; default: membank = 2; break; } pwdLevel = (byte)(cmbLevel.SelectedIndex); unAccPwd = Convert.ToUInt32(tEpcAccess.Text, 16); status = Api.Gen2SecLock(unAccPwd, membank, pwdLevel); if (status != 0) { lInfo.Items.Add("Lock EPC tag failed!"); return; } else { lInfo.Items.Add("Lock EPC tag success!"); lInfo.Items.Add(s); } }