Example: /Dongle/UniKey Sample

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/Dongle/UniKey Sample


Required plugins for this example: MBS Dongle Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Dongle/UniKey Sample

This example is the version from Sun, 24th Sep 2016.

Project "UniKey Sample.xojo_binary_project"
Class App Inherits ConsoleApplication
EventHandler Function Run(args() as String) As Integer UniKeySample // keep window open till you press return print "" print "press return to quit" dim s as string = Input End EventHandler
Protected Sub UniKeySample() dim cmd as string = "H=H^H, A=A*23, F=B*17, A=A+F, A=A+G, A=A<C, A=A^D, B=B^B, C=C^C, D=D^D" dim cmd1 as string = "A=A+B, A=A+C, A=A+D, A=A+E, A=A+F, A=A+G, A=A+H" dim cmd2 as string = "A=E|E, B=F|F, C=G|G, D=H|H" dim str1 as string = "abcdefghijklmnop" dim p1 as integer = 1234 // passwords dim p2 as integer = 1234 dim p3 as integer = 1234 dim p4 as integer = 1234 dim retCode as integer dim u as new UnikeyMBS //get version dim version as integer retcode = u.GetVersion(version) if retcode <> 0 then print "GetVersion error code: "+str(retCode) return end if print "UniKey lib ver: "+hex(version) // find dongle dim lp1 as integer = 1 dim lp2 as integer = 0 retcode = u.Find(lp1, lp2) if retcode <> 0 then print "UniKey_Find error code: "+str(retCode) return end if // return the hardware ID (HID) print "Find UniKey: "+ str(lp1) // open dongle retcode = u.UserLogon(p1, p2) if retcode <> 0 then print "UniKey_User_Logon error code: "+str(retCode) return end if retcode = u.VendorLogon(p1, p2, p3, p4) if retcode <> 0 then print "UniKey_Vender_Logon error code: "+str(retCode) return end if //get type dim type as integer = 0 retcode = u.GetType(type) if retcode <> 0 then print "UniKey_Get_Type error code: "+str(retCode) else print "UniKey_Get_Type: : "+str(type) end if End Sub
End Class
End Project

See also:

The items on this page are in the following plugins: MBS Dongle Plugin.


💬 Ask a question or report a problem