The manufacturers of the Barcode Reader should provide you with the drivers necessary to control it.
To connect to a usb you should use the System.IO class...
For example, the following code snippet will connect to a USB key (thumb drive), read it's information and create a text file on the USB key containing the USB key's information.
-
Try
-
'Making sure to demand permission to access USB
-
Dim myPerm As New FileIOPermission(PermissionState.Unrestricted)
-
myPerm.Demand()
-
-
Dim ValidDriveLetters As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-
Dim info As System.IO.DriveInfo
-
Dim sb As New StringBuilder
-
Dim i As Integer
-
Dim len As Integer = ValidDriveLetters.Length - 1
-
For i = 0 To len
-
info = New System.IO.DriveInfo(ValidDriveLetters(i))
-
If info.IsReady Then
-
If String.Compare(info.VolumeLabel, "NameOfMyUsbKey", True) = 0 Then
-
sb.Append(info.DriveFormat)
-
Dim wr As IO.StreamWriter = IO.File.AppendText(info.Name + "test.txt")
-
wr.WriteLine("AvailableFreeSpace: " + info.AvailableFreeSpace.ToString)
-
wr.WriteLine("DriveFormat: " + info.DriveFormat)
-
wr.WriteLine("DriveType: " + info.DriveType.ToString)
-
wr.WriteLine("Name: " + info.Name)
-
wr.WriteLine("TotalFreeSpace: " + info.TotalFreeSpace.ToString)
-
wr.WriteLine("TotalSize: " + info.TotalSize.ToString)
-
wr.WriteLine("VolumeLabel: " + info.VolumeLabel)
-
wr.Flush()
-
wr.Close()
-
End If
-
End If
-
Next
-
Catch ex As Exception
-
LBL_Error.Text = "Failed to get permissions: " + ex.Message + " " + ex.StackTrace
-
End Try
I doubt you are going to access your reader in this manner.
You're going to have to use the drivers to control your Barcode reader...contact the manufacturer for any software development kits available.
-Frinny