Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Attendance Machine Name : NAPCO
Modl : NP 1500 P

plzzz Help

i need Creat A connection with attendance machine and Download data from Machine To My Table in sql server by asp.net coding
Posted

You should talk to the people who created it - 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
 
I don't think anybody can help you by just know the machine name and it's model. You should consult the company and they will guide you how you can get the data from the machine; may be they provide you some API to do your task.
 
Share this answer
 
1- add ref to dll zkemkeeper.dll file

2- regsvr32 "D\zkemkeeper.dll" and press ok in run

3- past dll zkemkeeper.dll fil in sys32

and used this code in your project

// C# Code
Public axCZKEM1 As New zkemkeeper.CZKEM



Private bIsConnected = False
Private iMachineNumber As Integer

'Vb Code  Convert to c#
Private Sub btnConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConnect.Click

Dim idwErrorCode As Integer
Cursor = Cursors.WaitCursor
If btnConnect.Text = "Disconnect" Then
axCZKEM1.Disconnect()
bIsConnected = False
btnConnect.Text = "Connect"
MsgBox("Disconnected")
Cursor = Cursors.Default
Return
End If

bIsConnected = axCZKEM1.Connect_Net(txtIP.Text.Trim(), Convert.ToInt32(txtPort.Text.Trim()))
If bIsConnected = True Then
btnConnect.Text = "Disconnect"
btnConnect.Refresh()
MsgBox("Connected")
iMachineNumber = 1
axCZKEM1.RegEvent(iMachineNumber, 65535)
Else
axCZKEM1.GetLastError(idwErrorCode)
MsgBox("Unable to connect the device,ErrorCode=" & idwErrorCode, MsgBoxStyle.Exclamation, "Error")
End If
Cursor = Cursors.Default

End Sub
#End Region


''Vb Code  Convert to c#
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dwEnrollNumber As Long
Dim name As String
Dim password As String
Dim privileg As Long
Dim conexaoMySQL As SqlConnection
Dim strSQL As String
Dim dwVerifyMode As Long
Dim dwInOutMode As Long
Dim timeStr As String
Dim enable As Boolean
Dim _data As New System.Text.StringBuilder
Dim _errorCode As Integer
Dim _machineNumber As Integer
Dim _enrollNumber As Integer
Dim _enrollMachineNumber As Integer
Dim _verifyMode As Integer
Dim _inOutMode As Integer
Dim _year As Integer
Dim _month As Integer
Dim _day As Integer
Dim _hour As Integer
Dim _minute As Integer

axCZKEM1.ReadMark = True
axCZKEM1.GetLastError(_errorCode)
axCZKEM1.ReadAllUserID(1)
axCZKEM1.ReadMark = True
If (axCZKEM1.ReadGeneralLogData(1)) Then
axCZKEM1.GetLastError(_errorCode)
While axCZKEM1.GetGeneralLogData(1, _machineNumber, _enrollNumber, _enrollMachineNumber, _verifyMode, _inOutMode, _year, _month, _day, _hour, _minute)
axCZKEM1.GetGeneralLogDataStr(1, dwEnrollNumber, dwVerifyMode, dwInOutMode, timeStr)
axCZKEM1.GetUserInfo(1, dwEnrollNumber, name, password, privileg, enable)
Dim data1 As Integer = 0
Dim data2 As Integer = 1000000
conexaoMySQL = New SqlConnection("Data Source=Ahmad-PC;Initial Catalog=HR;User ID=sa;Password=*******")
If data1.ToString < _minute Then
strSQL = "INSERT INTO InOut (dwEnrollNumber,name,password,privileg,dwVerifyMode,dwInOutMode,timeStr,_machineNumber,_enrollNumber,_enrollMachineNumber,_verifyMode,_inOutMode,_year,_month,_day,_hour,_minute) VALUES ( '" & dwEnrollNumber & "','" & name & "','" & password & "','" & privileg & "','" & dwVerifyMode & "','" & dwInOutMode & "','" & timeStr & "','" & _machineNumber & "','" & _enrollNumber & "','" & _enrollMachineNumber & "','" & _verifyMode & "','" & _inOutMode & "','" & _year & "','" & _month & "', '" & _day & "','" & _hour & "','" & _minute & "')"

End If
Dim cmd As New SqlCommand(strSQL, conexaoMySQL)
conexaoMySQL.Open()
cmd.ExecuteNonQuery()
conexaoMySQL.Close()
End While
End If
axCZKEM1.RefreshData(1)
Dim query As String = "SELECT * FROM InOut"
Dim connection As New SqlConnection("Data Source=Ahmad-PC;Initial Catalog=HR;User ID=sa;Password=*******")
Dim da As New SqlDataAdapter(query, connection)
Dim ds As New DataSet()
If da.Fill(ds) Then
DataGridView5.DataSource = ds.Tables(0)
End If
DataGridView5.FirstDisplayedScrollingRowIndex = DataGridView5.Rows.Count - 1

End Sub


Alhlwany Egypt
Contact me
mail :moh.abdelmordy.it@gmail.com
 
Share this answer
 
v2
Comments
zeshanjadoon 12-Feb-16 6:59am    
me type of code in some other places, and i get the data in the list view and later to the SQL Database but data is very strange i mean dates and other things are encoded, can you guide me further how i can solve the problem. i am attaching one record of CheckIn and CheckOut for your review as i have to write the queries to show data like

User_ID | Date | CheckIn Time | Check out Time
how to fetch data from machine while the website or project is onine or not?
 
Share this answer
 
Comments
Deepu S Nair 11-Mar-15 0:46am    
Don't post your question as solution.

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