Click here to Skip to main content
14,240,765 members

VBScan barcode software

Rate this:
4.02 (33 votes)
Please Sign up or sign in to vote.
4.02 (33 votes)
23 Jun 2004GPL3
A barcode scanning and decoding software without third-party software


VBScan is a simple program to scan, decode and draw a barcode. It uses only .NET Framework and Windows API functions, no third party products.

It is designed to work with a "barcode wand" scanner that is connected to the com port (RS232) of a PC. Since most barcode wands have TTL voltages you'll need a converter chip to connect the wand to the PC.

After pressing the start button the program periodically checks the DSR line of the RS232. If a transition between black and white is detected it stores how many ticks the last bar was wide. After scanning and pressing stop the scanned barcode get "cleaned", so that we have no incorrect bars. If you now press decode the barcode will be decoded (only Code 3 of 9 supported at the moment) and the datastring is shown in a textbox.


I wrote this program as a project in school. It was designed to work, and nothing more. I'm not a programming professional, so the code is sometimes a bit ugly.

Using the code

I have written 3 classes: Barcode, Code39 and HighSpeedTimer

The Barcode class stores the scanned data in a simple integer array. The class also provides some functions to clean and draw the barcode.

The Code39 class provides functions to decode an barcode object. It only supports "Code 3 of 9" barcodes, but it wouldn't be a problem to implement other encoding variants too.

The HighSpeedTimer class is a wrapper around the windows API functions to time more exact than the normal timer. I had to do this because the resolution of the standard timer is not high enough to scan barcodes exactly. This is probably the most ugly part in my program. If you start the timer, it uses a high amount of processor power, despite the fact that it does actually nothing... If you can help me improve this class i would appreciate it.

In the download file you'll find all the classes mentioned above and a small program (see the screenshot) to test them.

Note: In the frmMain there is a Paint event of the picturebox to redraw the barcode. It works, but uses much CPU time...


  • 04-06-23: v0.9.1635 - first posted version


This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


About the Author

Austria Austria
No Biography provided

Comments and Discussions

QuestionHow to use? Pin
Member 117295091-Jun-15 17:52
memberMember 117295091-Jun-15 17:52 
GeneralMy vote of 5 Pin
Manoj Kumar Choubey23-Feb-12 19:27
professionalManoj Kumar Choubey23-Feb-12 19:27 
GeneralBarcode reader project Pin
Hanumanthappa.H28-Jan-11 4:36
memberHanumanthappa.H28-Jan-11 4:36 
Generaloffline Barcode verification System(URJENT) Pin
Member 321186330-Apr-09 20:39
memberMember 321186330-Apr-09 20:39 
Generalhelp Pin
lakshmi priya.t.n29-Jan-09 17:39
memberlakshmi priya.t.n29-Jan-09 17:39 
Questionhow to connect barcode machine with .net projects Pin
hiran53612-Jul-08 2:33
memberhiran53612-Jul-08 2:33 
GeneralHelp Please Urgent Pin
badenmaher6925-Feb-08 6:12
memberbadenmaher6925-Feb-08 6:12 
QuestionBarcode help Pin
badenmaher6913-Feb-08 9:52
memberbadenmaher6913-Feb-08 9:52 
GeneralBar Code Reader Pin
Veera Raghavan6-Sep-07 4:21
memberVeera Raghavan6-Sep-07 4:21 
Generalusing barcode Pin
jotapz30-Jul-07 16:57
memberjotapz30-Jul-07 16:57 
GeneralGEnerating Barcode Pin
abhijit.dalvi294-May-07 1:22
memberabhijit.dalvi294-May-07 1:22 
Questionbarcode printing Pin
tsalim3-May-07 23:52
membertsalim3-May-07 23:52 
AnswerRe: barcode printing Pin
manojhdwr@gmail.com14-Oct-11 22:42
membermanojhdwr@gmail.com14-Oct-11 22:42 
AnswerRe: barcode printing Pin
manojhdwr@gmail.com14-Oct-11 22:42
membermanojhdwr@gmail.com14-Oct-11 22:42 
AnswerMessage Closed Pin
4-Mar-12 23:13
memberblueskysinger4-Mar-12 23:13 
GeneralAutomated DTR attendance using Barcode scanner Pin
hardguy2-Oct-06 21:33
memberhardguy2-Oct-06 21:33 
GeneralRe: how to deploy the usercontrol in aspx page Pin
Madduri Rahul Rajasekhar12-Sep-06 20:14
memberMadduri Rahul Rajasekhar12-Sep-06 20:14 
GeneralBarcode font Code 128 Pin
angelagke31-Jul-06 18:39
memberangelagke31-Jul-06 18:39 
Generaldata scanning through barcode scanners Pin
behzad nasim31-Mar-06 2:15
memberbehzad nasim31-Mar-06 2:15 
GeneralRe: data scanning through barcode scanners Pin
manojhdwr@gmail.com14-Oct-11 22:45
membermanojhdwr@gmail.com14-Oct-11 22:45 
Generalhelp me, please! Pin
4aaaa10-Mar-06 16:13
member4aaaa10-Mar-06 16:13 
GeneralRe: help me, please! Pin
hungpvtn23-Apr-06 1:26
memberhungpvtn23-Apr-06 1:26 
QuestionNeed Help ? Pin
| Muhammad Waqas Butt |14-Jan-06 22:11
professional| Muhammad Waqas Butt |14-Jan-06 22:11 
GeneralRs232.vb Pin
toniolol16-Jun-05 4:41
membertoniolol16-Jun-05 4:41 
GeneralRe: Rs232.vb Pin
hungpvtn23-Apr-06 1:27
memberhungpvtn23-Apr-06 1:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Posted 23 Jun 2004


190 bookmarked