basically i use a USB serial number security function where the user must have the USB drive inserted into their machine for my app to load.
on my machine this functions perfectly within a timley manner (couple of seconds) both in reporting an error if the drive is missing or moving on if its present. However on a users/clients machine if the USB is missing the app does not crash but takes it sweet time to report the USB missing, and ultimatley the user gets jack of waiting for it so they alt+ctl+del out of my app.
am i missing something, is this a bad idea for security?? or am i able to excluded particular drives from the serial number scan like A: and C: etc to save time..........................???
my code looks like this
cheersCode:If LicenseInfo.blnLoadNormal = True Then txtValidationKey.Visible = True Timer3.Enabled = False Dim X As Integer Dim Serial As Long Dim VName As String Dim FSName As String Dim ret As Integer For X = 0 To Drive1.ListCount - 1 Serial = 0 VName = String$(255, Chr$(0)) FSName = String$(255, Chr$(0)) GetVolumeInformation Drive1.List(X) & "\", VName, 255, Serial, 0, 0, FSName, 255 If Serial = CorrectSerial Then GoTo CorrectDriveInserted Else If Serial = VDMasterSerial Then GoTo CorrectDriveInserted End If End If Next X 'Correct usb drive wasnt found, tell them, then exit the sub ret = MsgBox("Please insert the correct Software Key and Restart the program", vbOKOnly, "Incorrect Software Key") End Else Timer3.Enabled = False Exit Sub End If CorrectDriveInserted: LicenseInfo.strUSBDriveLetter = Drive1.List(X) 'this assigns the USB Key Drive letter to the Variable in mod LicenseInfo CheckUpdate




Reply With Quote