Click here to Skip to main content
16,016,335 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
Hi Everyone

I have a Biometric Device from ZKTeco Company. Through my C# Code i can successfully connect to the device, Ping it etc.
However, i am unable to add user Data(such as Username, password etc.) to the device using the SDK's(Zkemkeeper.dll) SSR_SetUserInfo function. I don't get any Error or Warning for my code at Compile or Run time. On my Form i have two buttons WriteData(to add user Data) and ReadData(to access user Data). I want to display data on the Form let us say as a list(code for which has not been written as yet). The code for both the buttons(WriteData and ReadData) is written below:
private void btn_WriteData_Click(object sender, EventArgs e)
        {
int MachineNumber = 1;
string EnrollNumber = "1";
string Name = "Mich";
string Password = "123";
int Privilege = 1;
bool Enabled = true;
 
objZkeeper.SSR_SetUserInfo(MachineNumber, EnrollNumber, Name, Password, Privilege, Enabled);
 
     }

private void btn_ReadData_Click(object sender, EventArgs e)
        {
int MachineNumber = 1;
string EnrollNumber = "";
string Name = "";
string Password = "";
int Privilege = 0;
bool Enabled = true;
objZkeeper.SSR_GetUserInfo(MachineNumber, EnrollNumber, out Name, out Password, out Privilege, out Enabled);
         }

Any help in this regard is highly appreciated.

Best Regards
MS

What I have tried:

I have tried to get answer from the web but have not been successful in getting the desired answer.
Posted
Updated 28-May-22 21:59pm
v2
Comments
Richard MacCutchan 9-Jan-18 11:37am    
The best people to help you will be the suppliers of this device and its software.

You should talk to the people who created it - ZKTeco Support[^] - they should provide technical support and will know more about their product than we will. If they don't, then find another supplier and demand your money back!
 
Share this answer
 
Comments
MichaelSmith2017 12-Jan-18 21:19pm    
@OriginalGriff:
I have investigated the code further and found out that the Function "SSR_SetUserInfo" returns a Boolean Value so i have made a change in the code of button "btn_WriteData_Click". I have now stored the boolean value in a variable "result" and added code for successful write operation which is a MessageBox which displays "Result Stored in the Device" in Case returned Boolean value is "True" or otherwise (as shown below). When i now click this button i get the message "Result Stored in the Device" so i believe data has been stored in the device. I also made similar changes to the code of button "btn_ReadData_Click"(as shown below) and found similar results so i believe read operation is also a success.
Now, i need to display data on the form when the second button "btn_ReadData_Click" is clicked. Can you guide me what should i add in the code of "btn_ReadData_Click"?

Best Regards

MS

private void btn_WriteData_Click(object sender, EventArgs e)
{
int MachineNumber = 1;
string EnrollNumber = "1";
string Name = "Mich";
string Password = "123";
int Privilege = 1;
bool Enabled = true;


bool result = objZkeeper.SSR_SetUserInfo(MachineNumber, EnrollNumber, Name, Password, Privilege, Enabled);

if (result == true)
{
MessageBox.Show("Result Stored in the Device");

}
else
{
MessageBox.Show("Result Not Stored in the Device");
}

}

private void btn_ReadData_Click(object sender, EventArgs e)

{

int MachineNumber = 1;

string EnrollNumber = "1";

string Name = "";

string Password = "";

int Privilege = 0;

bool Enabled = true;

bool result = objZkeeper.SSR_GetUserInfo(MachineNumber, EnrollNumber, out Name, out Password, out Privilege, out Enabled);




if (result == true)

{

MessageBox.Show("Result Retrieved");

}

else

{

MessageBox.Show("Result Not Retrieved");
}

}
[no name] 11-Feb-18 15:01pm    
Hi, Can you share if your biometric machine supports the password? May i know what model you are using for testing? Can you also share if you tried check if the password is updated in the machine, other than testing through your code?
just add the line before
objZkeeper


objZkeeper.EnableDevice(MachineNumber , false);

and after you finish add this line

objZkeeper.EnableDevice(MachineNumber , true);
 
Share this answer
 
Comments
Vương Trịnh 2024 31-May-24 4:13am    
Hello Sir, i have the same issues with this author, I wanna add new user to my device by my application use SSR_SetUserInfo() method. It's returns true but I can't see this record in my device.
Here is my code

public bool PushUserDataToDevice(ZkemClient objZkeeper, int machineNumber, string enrollNo)
{
string userName = "test";
string password = "123";
bool enable = true;
int privelage = 1;
objZkeeper.EnableDevice(machineNumber, false);
bool check = objZkeeper.SSR_SetUserInfo(machineNumber, enrollNo, userName, password, privelage, true);
if (check)
{
objZkeeper.RefreshData(machineNumber);
bool checkContain = objZkeeper.SSR_GetUserInfo(machineNumber, enrollNo, out userName, out password, out privelage, out enable);
objZkeeper.EnableDevice(machineNumber, true);
if (checkContain) return checkContain;
}
return false;
}
solution 1 in the comments mentioned code is working

Thanks
Ram
 
Share this answer
 
Comments
CHill60 30-May-22 2:56am    
This is not a solution. If you want to comment on a post then use the "Have a Question or Comment?" link next to the relevant post.
Vương Trịnh 2024 31-May-24 4:14am    
Hello Sir, i have the same issues with this author, I wanna add new user to my device by my application use SSR_SetUserInfo() method. It's returns true but I can't see this record in my device.
Here is my code

public bool PushUserDataToDevice(ZkemClient objZkeeper, int machineNumber, string enrollNo)
{
string userName = "test";
string password = "123";
bool enable = true;
int privelage = 1;
objZkeeper.EnableDevice(machineNumber, false);
bool check = objZkeeper.SSR_SetUserInfo(machineNumber, enrollNo, userName, password, privelage, true);
if (check)
{
objZkeeper.RefreshData(machineNumber);
bool checkContain = objZkeeper.SSR_GetUserInfo(machineNumber, enrollNo, out userName, out password, out privelage, out enable);
objZkeeper.EnableDevice(machineNumber, true);
if (checkContain) return checkContain;
}
return false;
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900