Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class ZKEMEventsClass
- Public CZKEM2 As New zkemkeeper.CZKEM
- Public MyNewWrapperClass As MyWrapperClass
- Public Sub AddBioHandler(iDevice As String, iIP As String, iPort As Integer)
- If CZKEM2.Connect_Net(iIP, iPort) Then
- If CZKEM2.RegEvent(1, 65535) = True Then
- MyNewWrapperClass = New MyWrapperClass(iDevice, CZKEM2)
- AddHandler MyNewWrapperClass.AttEventWrapper, AddressOf LogRaised
- Else
- MsgBox("Error Registering Events")
- End If
- Else
- MsgBox("Error Connecting to Device")
- End If
- End Sub
- Public Sub RemoveBioHandler(iDevice As String, CZKEM As zkemkeeper.CZKEM)
- '----------------------------------------------------------
- 'RemoveHandler MyNewWrapperClass.AttEventWrapper, AddressOf LogRaised
- 'I DONT KNOW IF I SHOULD REMOVE THE HANDLER HERE
- '----------------------------------------------------------
- End Sub
- Public Sub LogRaised(ByVal SenderName As String, ByVal sEnrollNumber As String, ByVal iIsInValid As Integer, ByVal iAttState As Integer, ByVal iVerifyMethod As Integer, ByVal iYear As Integer, ByVal iMonth As Integer, ByVal iDay As Integer, ByVal iHour As Integer, ByVal iMinute As Integer, ByVal iSecond As Integer, ByVal iWorkCode As Integer)
- MsgBox("Raised event details here... [EnrollID, Year, Month, Day]...")
- End Sub
- End Class
- Sub ConnectToDevice()
- Dim iIP As String
- Dim iDevice As String
- Dim iPort As Integer
- For x = 1 To 2
- Select Case x
- Case 1
- iIP = "122.3.47.43"
- iDevice = "Device 1"
- Case 2
- iIP = "192.168.10.201"
- iDevice = "Device 2"
- End Select
- 'This is the section where I create new instance of my ZKEMEventsClass
- Dim NewConnect As New ZKEMEventsClass
- NewConnect.AddBioHandler(iDevice, iIP, iPort)
- Next
- End Sub
- Sub DisconnectFromDevice()
- 'THIS IS WHERE I ENTER MY RemoveHandler CODES BUT NOT WORKING
- Dim NewConnect as New ZKEMEventsClass
- NewConnect.RemoveBioHandler(iDevice, iIP, iPort)
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement