This event is triggered when a Mifare card is emptied.
Result of emptying a card. 0: Success. Other values: Failure.
//Create Standalone SDK class dynamicly. zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass(); //the boolean value identifies whether the device is connected int iMachineNumber = 1; private void Connect_OnEmptyCard(string sIp = "10.0.0.44", int iPort = 4370, int iMachineNumber = 1) { //the boolean value identifies whether the device is connected bool bIsConnected = false; //the serial number of the device.After connecting the device ,this value will be changed. int idwErrorCode = 0; bIsConnected = axCZKEM1.Connect_Net(sIp, iPort); if (bIsConnected == true) { iMachineNumber = 1;//In fact,when you are using the tcp/ip communication,this parameter will be ignored,that is any integer will all right.Here we use 1. axCZKEM1.RegEvent(iMachineNumber, 65535);//Here you can register the realtime events that you want to be triggered(the parameters 65535 means registering all) this.axCZKEM1.OnEmptyCard += new zkemkeeper._IZKEMEvents_OnEmptyCardEventHandler(axCZKEM1_OnEmptyCard); } else { axCZKEM1.GetLastError(ref idwErrorCode); MessageBox.Show("Unable to connect the device,ErrorCode=" + idwErrorCode.ToString(), "Error"); } } private void axCZKEM1_OnEmptyCard(int iActionResult) { MessageBox.Show("RTEvent OnEmptyCard Has been Triggered..."); if (iActionResult == 0) { MessageBox.Show("...Empty Mifare Card OK"); } else { MessageBox.Show("...Empty Failed"); } } private void Disconnect_OnEmptyCard() { axCZKEM1.Disconnect(); this.axCZKEM1.OnEmptyCard -= new zkemkeeper._IZKEMEvents_OnEmptyCardEventHandler(axCZKEM1_OnEmptyCard); }
'Create Standalone SDK class dynamicly. Dim axCZKEM1 As New zkemkeeper.CZKEM Private Sub Connect_OnEmptyCardd(sIp As String, iPort As Integer, iMachineNumber As Integer) axCZKEM1.Connect_Net(sIp, iPort) 'the boolean value identifies whether the device Is connected Dim bIsConnected As Boolean = False 'the serial number of the device.After connecting the device ,this value will be changed. Dim idwErrorCode As Integer = 0 bIsConnected = axCZKEM1.Connect_Net(sIp, iPort) If bIsConnected = True Then iMachineNumber = 1 'In fact,when you are using the tcp/ip communication,this parameter will be ignored,that is any integer will all right.Here we use 1. axCZKEM1.RegEvent(iMachineNumber, 65535) 'Here you can register the realtime events that you want to be triggered(the parameters 65535 means registering all) AddHandler axCZKEM1.OnEmptyCard, AddressOf AxCZKEM1_OnEmptyCard Else axCZKEM1.GetLastError(idwErrorCode) MsgBox("Unable to connect the device,ErrorCode=" & idwErrorCode, MsgBoxStyle.Exclamation, "Error") End If End Sub Private Sub AxCZKEM1_OnEmptyCard(ByVal iActionResult As Integer) MsgBox("RTEvent OnEmptyCard Has been Triggered...") If iActionResult = 0 Then MsgBox("...Empty Mifare Card OK") Else MsgBox("...Empty Failed") End If End Sub Private Sub Disconnect_OnEmptyCard() 'Create Standalone SDK class dynamicly. Dim axCZKEM1 As New zkemkeeper.CZKEM axCZKEM1.Disconnect() RemoveHandler axCZKEM1.OnEmptyCard, AddressOf AxCZKEM1_OnEmptyCard End Sub