private void cmdGetDeviceStaus_Click(object sender, EventArgs e) { int vStatus; int vValue = 0; int vErrorCode = 0; Boolean vRet; lblMessage.Text = "Working..."; Application.DoEvents(); vStatus = cmbSatus.SelectedIndex + 1; vRet = bpc.EnableDevice(Program.gMachineNumber, 0); // 0 : false if (!vRet) { lblMessage.Text = util.gstrNoDevice; return; } vRet = bpc.GetDeviceStatus(Program.gMachineNumber, vStatus, ref vValue); if (vRet) { switch (vStatus) { case 1: lblMessage.Text = "(1) = Manager count = " + vValue; break; case 2: lblMessage.Text = "(2) = User count = " + vValue; break; case 3: lblMessage.Text = "(3) = Fp count = " + vValue; break; case 4: lblMessage.Text = "(4) = Password count = " + vValue; break; case 5: lblMessage.Text = "(5) = SLog count = " + vValue; break; case 6: lblMessage.Text = "(6) = GLog count = " + vValue; break; case 7: lblMessage.Text = "(7) = Card count = " + vValue; break; case 8: lblMessage.Text = "(8) = Alarm status = " + vValue; break; } } else { bpc.GetLastError(ref vErrorCode); lblMessage.Text = util.ErrorPrint(vErrorCode); } bpc.EnableDevice(Program.gMachineNumber, 1); // 1 : true }