Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
FingerPrintDeviceEntity fingerPrintDeviceEntity = new FingerPrintDeviceEntity();
_SBXPC1 = new SBXPCLib.SBXPC();

fingerPrintDeviceEntity = new FingerPrintDeviceController().SelectByMachineID(ddlMachineNo.SelectedValue.ToString());
machineNumber = Convert.ToInt32(fingerPrintDeviceEntity.MachineNo);
ipaddress = fingerPrintDeviceEntity.IPaddress;

_SBXPC1.EnableDevice(machineNumber, 0);

if (_SBXPC1.ConnectTcpip(machineNumber, ref ipaddress, Convert.ToInt32(fingerPrintDeviceEntity.PortNo), 0))
{
UpdateProgress1.Visible = true;

_SBXPC1.ReadAllGLogData(machineNumber);
int TmachineNumber = 0; int EnrollNo = 0; int EmachineNumber = 0; int VerifyMode = 0;
int Year = 0; int Month = 0; int Day = 0; int Hour = 0; int Minute = 0; int Second = 0;

while (_SBXPC1.GetAllGLogData(machineNumber, ref TmachineNumber, ref EnrollNo, ref EmachineNumber, ref VerifyMode, ref Year, ref Month, ref Day, ref Hour, ref Minute, ref Second))
{
try
{
DateTime attendanceDate = Convert.ToDateTime(Year + "/" + Month + "/" + Day);
String attendanceTime = Convert.ToString(Hour.ToString().PadLeft(2, '0') + ":" + Minute.ToString().PadLeft(2, '0') + ":" + Second.ToString().PadLeft(2, '0'));

AttendanceFingerPrintController AttendanceFingerPrintController = new AttendanceFingerPrintController();
if (AttendanceFingerPrintController.Insert(attendanceDate, attendanceTime, Convert.ToString(EnrollNo)))
{
lblMessage.Text = "Attendance download is running Successfully.";
this.AceDatePicker1.Enabled = true;
this.AceDatePicker2.Enabled = true;
}

}
catch (Exception ex)
{
lblMessage.Text = "Error Occured.";
return;
}
}
}
else
{
UpdateProgress1.Visible = false;
lblMessage.Text = "There is no connection to Fingure Devices.";
return;
}

_SBXPC1.Disconnect();
UpdateProgress1.Visible = false;
lblMessage.Text = "Attendance download is running Successfully.";
Posted
Comments
Richard MacCutchan 4-Sep-15 6:33am    
Please format your code properly, and show exactly where the error occurs.
Member 11168208 7-Sep-15 1:15am    
i make trace but this point has stop(_SBXPC1.ConnectTcpip()) that error has been show me "Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))".
i think SBXPCLib.dll file is somethings need if you know please give me advice thanks
Richard MacCutchan 7-Sep-15 3:15am    
You need to contact the manufacturers of the device for help. It is unlikely that anyone here knows anything about either the device or its software library. Are you certain that it has a normal TCP/IP interface?
ZurdoDev 4-Sep-15 7:24am    
As mentioned give more details. Is the device plugged in? Did this work before?
sreeyush sudhakaran 6-Sep-15 1:57am    
I think there is some problem with your port connection , please check
1.Your device is connected physically
2.The port you assigned is available port in system in which you run this code.
3.Check if the fire wall or proxy is blocking your application communication through TCP/IP

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