If dongle is present I should get output as success or else fail using vb.net?

28 Views Asked by At

I need to check the application before login whether if there's a dongle is inserted in that systems USB if dongle not present the message should pass as FAILed. This is the code I have used

Public Shared Function dongle1()
    Dim vendorCode As String = ""
    Dim feature As AKSHASP.HaspFeatureOptions =
        AKSHASP.HaspFeatureOptions.haspOptionDefault

    Dim hasp As AKSHASP.Hasp = New AKSHASP.Hasp(feature)
    Dim status As AKSHASP.HaspStatusCodes = hasp.Login(vendorCode)

    If status = AKSHASP.HaspStatusCodes.haspStatusOk Then
        MsgBox("Success")
    Else
        MsgBox("fail")
    End If
End Function

I need some reference codes about how to use safenet Hasp with VB.net

0

There are 0 best solutions below