Results 1 to 3 of 3

Thread: USB Serial errors

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2007
    Location
    Melbourne, Australia
    Posts
    362

    USB Serial errors

    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

    Code:
        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
    cheers
    Last edited by aztrix; Dec 19th, 2007 at 04:21 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width