detecting usb token in vb
hi
is it possible for me to develop an application which can autodetect whenever a usb token is inserted into the usb slot, then launchs a program automatically?
I have the usb token's sdk..but i'm not sure how to do this..by the way the token is using cryptoki dll (if this information may help).
Re: detecting usb token in vb
Mmh no one replied to this one yet? Tss...
Well hardware detection requires use of the WMI interface (Hope you got your SQL skills up as the WMI is basically a sorta query DB ;)). Scan the WMI for the USB name. Basically if you find it it's connected.
Some more info on WMI -> http://msdn.microsoft.com/library/de..._reference.asp
Edit: I'll make it a lot easier for ya now:
An example of how to query network adapters.. :)
VB Code:
strComputer = "."
Set objWMIService = _
GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetCards = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration " _
& "Where IPEnabled = True")
For Each objNetCard in colNetCards
errResult = objNetCard.SetTCPIPNetBIOS(1)
If errResult Then
WScript.Echo "Error number: " & Err.Number & _
vbNewLine & _
"Description: " & Err.Description
Else
WScript.Echo "NetBIOS enabled over TCPIP"
End If
Next
G'luck :)