Professional Documents
Culture Documents
Bio Auto Time Sync Script
Bio Auto Time Sync Script
Bio Auto Time Sync Script
Console.ReadLine();
if (bIsConnected == false)
{
Console.Write("Please connect the device first");
return;
}
//Cursor = Cursors.WaitCursor;
if (axCZKEM1.SetDeviceTime(iMachineNumber))
{
axCZKEM1.RefreshData(iMachineNumber);//the data in the device should be
refreshed
Console.Write("Successfully set the time of the machine and the
terminal to sync PC!");
int idwYear = 0;
int idwMonth = 0;
int idwDay = 0;
int idwHour = 0;
int idwMinute = 0;
int idwSecond = 0;
if (axCZKEM1.GetDeviceTime(iMachineNumber, ref idwYear, ref idwMonth, ref
idwDay, ref idwHour, ref idwMinute, ref idwSecond))//show the time
{
//txtGetDeviceTime.Text = idwYear.ToString() + "-" +
idwMonth.ToString() + "-" + idwDay.ToString() + " " + idwHour.ToString() + ":" +
idwMinute.ToString() + ":" + idwSecond.ToString();
}
else
{
axCZKEM1.GetLastError(ref idwErrorCode);
Console.Write("Operation failed,ErrorCode=" + idwErrorCode.ToString());
}
// Cursor = Cursors.De
}