Hello everybody
I'm developing application using visual C#, and also using Barcode reader connected to USB port, some time i need to stop the barcode reader from reading when the cursor will be in another TextBox, for example when it is inside the price TextBox i don't want it to work.
Please if you have any information it will be helpful to me.
thanks in advance to all of you.
5 31727
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
Thank you Frinavale for your replay.
The barcode reader is working properly like a keyboard without any driver software, immediatly after i connected to the computer, i need only to stop it from working through my application using VC#.
The manufactory didn't give me any details about this.
from this website you can see the barcode reader which i purchased.
http://www.svbinternational.com/bar_code_scanners/bar_code_scannerusb.htm
model: SVB-0006
Hello
I dint get your question properly,
when ever you are reading a barcode then the details related to that will be retrived from the existing database, when you are using the barcode for your purpose why you need to enter text again .can you give some more clarification about your application.
Thank you Frinavale for your replay.
The barcode reader is working properly like a keyboard without any driver software, immediatly after i connected to the computer, i need only to stop it from working through my application using VC#.
The manufactory didn't give me any details about this.
from this website you can see the barcode reader which i purchased.
http://www.svbinternational.com/bar_code_scanners/bar_code_scannerusb.htm
model: SVB-0006
Hello everybody
I'm developing application using visual C#, and also using Barcode reader connected to USB port, some time i need to stop the barcode reader from reading when the cursor will be in another TextBox, for example when it is inside the price TextBox i don't want it to work.
Please if you have any information it will be helpful to me.
thanks in advance to all of you.
A barcode reader is an external device that will do it's own thing when certain events trigger it to process things (like when it is presented with a barcode).
I don't think that you'll be able to stop this from happening.
-Frinny
If the barcode acts like a keyboard, you need to research ways to disable keyboards(perferably a desired keyboard and not all keyboard) or look for ways to disable USB-DEVICES in general.
I would guess that it sends windows messages with the key strokes just the way the real keyboard does, so it would be hard to tell the difference.
On the DriveInfo class, I was unaware of that (DriveInfo.GetDrives() might be better then polling through a letter array). I would be interested to see if this recognizes drives that are mounted to a directory and not a drive letter.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: ^CeFoS^ |
last post by:
Hello to everybody,
I've done an application that draws in a frame the trajectory of a
robot. The robot position is readed through the serial port, and
several commands are wrote through the...
|
by: Kevin |
last post by:
Hi all
I am having a problem reading from a serial port, first of all I have now resorted to using the MSComm ActiveX control on my Windows Forms to provide me with the interface to my serial...
|
by: henrycortezwu |
last post by:
Hi All,
I'm trying to connect to a virtual port (COM19, OUTGOING, "Bluetooth
Serial Port") using VS2005 System.IO.Ports.
When I ran the ff code below here's what happens.
1) VS2005 Compiles w/o...
|
by: Marco |
last post by:
Could anyone please tell me why the program has the following error? I
copy the program from http://www.beyondlogic.org/parlcd/parlcd.htm
...
|
by: bmearns |
last post by:
Is it possible to specify which port to use as the outbound port on a
connection? I have the IP address and port number for the computer I'm
trying to connect to (not listening for), but it's...
|
by: 14Dallas |
last post by:
Hi,
I have been working with another programmer to write this code. I haven't written code in years - DBase III and Pascal - anyways, back to my code question.
The program opens a file and...
|
by: davetelling |
last post by:
I'm a newbie that is still struggling with OOP concepts & how to make things
work they way I want. Using Visual C# Express, I have a form in which I added
a user control to display a graph, based...
|
by: evle |
last post by:
haw to read data from an Infrared Infrared Remote Control
|
by: Frank Swarbrick |
last post by:
We are just starting to use DB2. I have a question about Control Center and
port 523. Our DBA set up a database that listens on port 30280 (I have no
idea where that port number came from...). ...
|
by: AaronL |
last post by:
Hello,
I am currently working on a project that has me in sort of a bind. What I want to do is retrieve web pages from the internet, and strip them down to just text. I'll get using Regular...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |