The attendance machine used by the company is the fingerprint attendance machine of the control, but the model of the control is messy, the model which is read out by the program is inconsistent with the actual Standard model.
In addition, the C # version of the supplied development package is called in the demo
Axczkem1.readalluserid (Imachinenumber);
Called after
Axczkem1.ssr_getalluserinfo (Imachinenumber, out-sdwenrollnumber, out-sName, out-Spassword, out-Iprivilege, out bEnabled)
To get all the user information, the returned sname (employee name) is always at the back of a few more bytes at a time, although Windows automatically blocks garbled characters when displayed in the ListView in the demo, but the program is still garbled when it is processed.
Use the following method to resolve the problem and resolve the correct employee name from the sname.
//handling extra characters in a name//UTF8 the length of the encoded byte array, the number of Chinese characters in the name = (byte[] length -10)/6+2//extracting Chinese characters = 0 of the byte array begins, the number of Chinese characters in the name if(NULL!=sName) { byte[] Namebytes =System.Text.Encoding.UTF8.GetBytes (sName); if(Namebytes.length >=Ten) { intNamelength = (Namebytes.length-Ten) /6+2; SName= System.Text.Encoding.UTF8.GetString (Namebytes,0,3*namelength); } /*switch (namebytes.length) {case 22: SName = System.Text.Encoding.UTF8.GetString (namebytes, 0, 12); Break Case 16:sname = System.Text.Encoding.UTF8.GetString (namebytes, 0, 9); Break Case 10:sname = System.Text.Encoding.UTF8.GetString (namebytes, 0, 6); Break Default:sname = Getchinese (sName); Break } */ } Else{sName="NULL"; }
By the way the slot under the central control of the attendance Machine SDK:
Unable to get the attendance data for the specified time, it must be downloaded in full volume each time.
By the way, the quality of the demo:
The programming style is very rigorous, the code comment is very detailed. Praise!
Processing of employee names in the use of the SDK for the central control attendance machine (C #)