ClearData

Definition

Usage

Clear the record specified by DataFlag from the device.

Parameter

Device number

DataFlag

Type of the records to be cleared. The value ranges from 1 to 5. The meanings are as follows:

1. Attendance record

2. Fingerprint template data

3. None

4. Operation record

5. User information

When the value of this parameter is 5, all user data in the device is deleted. Note: All fingerprint templates are also deleted.

Return Value

Return True if it is successful, or return False.

Related Function

ClearKeeperData

 

Ejemplo

C#

private static int clearData(string ipAddr, int port, int flag)
        {
int idwErrorCode = 0;
//Create Standalone SDK class dynamicly.
            zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass();
if (axCZKEM1.Connect_Net(ipAddr, 4370))
            {
int iMachineNumber = 1;
if (axCZKEM1.ClearData(iMachineNumber, flag))
                {
                    MessageBox.Show("Operation Success! All Data cleared from device: " + ipAddr);
                }
else
                {
                    axCZKEM1.GetLastError(ref idwErrorCode);
                    MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error");
                }
            }
else
            {
                axCZKEM1.GetLastError(ref idwErrorCode);
            }
return idwErrorCode;
        }

VB

Private Sub clearData(ipAddr As String, port As Int32, flag As Int32)
'Create Standalone SDK class dynamicly.
Dim axCZKEM1 As New zkemkeeper.CZKEM
Dim iMachineNumber As Integer
Dim idwErrorCode As Integer
If axCZKEM1.Connect_Net(ipAddr, port) = True Then
Dim iDelay As Integer = 4 'time to delay
If axCZKEM1.ClearData(iMachineNumber, flag) = True Then
                MsgBox("Operation Success! Data cleared from device: " + ipAddr)
Else
                axCZKEM1.GetLastError(idwErrorCode)
                MsgBox("Operation failed,ErrorCode=" & idwErrorCode.ToString(), MsgBoxStyle.Exclamation, "Error")
End If
Else
            axCZKEM1.GetLastError(idwErrorCode)
End If
End Sub