How to generate barcode and how to read that BarCode in .Net using C#, anybody can help me?
not sure if this will help you.
You have to purchase a barcode reader(of course)
The barcode reader will come with drivers and software for interfacing with your PC.
The software will connect to your database.
The sofware will allow you to create barcodes for your products using data in your database.
Hope this helps
Here is some code that i have in asp. While it might not be the best, it does get the job done for certian things.
I dont remember where the web site is that i grabbed it from but i left the header in tack. The web address does not take you to the app but you might be able to search and find it.
I have used it for reports where i put the barcode at the bottom of the report and then the user on the production floor can scan the report and it will bring up the record for them.
Hope this helps.
Need the 2 images as well
' Barcode Generator (c) 2003, Lake Avenue Church, www.lakeave.org
' This program will generate the simpler Code39 (or Code 3-for-9) barcodes.
' You'll find these barcodes on staff and student ID badges, video rental
' cards and so on.
' Basically, the code starts and ends with an asterisk.
' Inbetween the *'s, you can use - , $ / + %, space, A-Z and 0-9.
' Code39 works with alternating bands of black and white. Each character
' is represented by 7 bands. The band is either wide or narrow. Inbetween
' each character there is a band of white the same width as the narrow band.
' This code looks for the string strBarCode, which is not defined in this
' code. It's assumed that you would define the variable and then call the
' program as an include.
' Height and Width are defined by the variables numWidth and numHeight,
' allowing you to customize as needed.
' The code could probably be optimized and cleaned up; this was just a quick
' program to solve a need we had here. If you find the code useful, I'd
' love to hear from you. James Lamb, email@example.com
strBarCode = "8227"
strBarCode="*" & strBarCode & "*"
' response.write strBarCode
for t=1 to len(strBarCode)
for s=1 to 44
if mid(strBarCode,t,1)=left(a(s),1) then
strConv=strConv & right(a(s),9)&"s"
' response.write strconv & "<p>"
for t=1 to len(strConv)
if mid(strConv,t,1)="n" then
if b=1 then response.write "<img src=images/shim_black.gif width=" & numNarrow & " height=" & numHeight & ">"
if b=0 then response.write "<img src=images/shim.gif width=" & numNarrow & " height=" & numHeight & ">"
if b=2 then b=0
if mid(strConv,t,1)="w" then
if b=1 then response.write "<img src=images/shim_black.gif width=" & numNarrow*2 & " height=" & numHeight & ">"
if b=0 then response.write "<img src=images/shim.gif width=" & numNarrow*2 & " height=" & numHeight & ">"
if b=2 then b=0
if mid(strconv,t,1)="s" then
response.write "<img src=images/shim.gif width=" & numNarrow & " height=" & numHeight & ">"
in fact, that is not a tough task. i think you just need to employ a barcode generator to do that.there are many of them on the internet , you can just download one and follow the turioals . using a barcode generator is much easier and more convenient, yo ucan have a try, good luck!
Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic.It is extremely helpful for me.
One thing that needs be made clear is that there are different kinds of barcode generator according to different platforms. So first you should make sure which platform you would like to create barcode in. For example, if you want to create barcode in C#, you should make choose one of these types barcode generators: C# barcode generator library in ASP.NET and C# barcode generator library for WinForms. Make use which is one is suitable for you and then make full use of Google. Of course, there are many other types of barcode generators, you can check by yourself. This is just an example.
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="BarCodes.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<form id="Form1" method="post" runat="server">
<asp:Image id="myBarCode" runat="server"></asp:Image>
/// <summary />
/// Summary description for WebForm1.
/// </summary />
public class WebForm1 : System.Web.UI.Page
protected System.Web.UI.WebControls.Image myBarCode;
private void Page_Load(object sender, System.EventArgs e)
// Put user code to initialize the page here
myBarCode.ImageUrl = "BarCode.aspx?code=31231";
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
/// <summary />
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary />
private void InitializeComponent()
this.Load += new System.EventHandler(this.Page_Load);
there are many ways to do that. If you wanna save these complicated steps and find a easy way, you can google barcode generator and you will find many useful tools, or google how to create barcode in c# to get instructive articles. Good luck I think some imaging sdk programmes can enable to quickly generate barcodes. i have use imaging sdkr which can original layouts hyperlinks, Images and tables retained in word ,text, image, Epub, html.but i forgot download the wedsite ,go to google. By the way , pay attention to your system platform, select the suitable one . I use a barcode generator driver found on the internet . Install it and it becomes a selectable option.Then you can generate barcodes in many formats in any program at all, including Adobe Acrobat . Just open the sdk, select barcode, and choice a form you want, then you can generate barcode in c#, vb, asp ,etc ,the task will be finished in several seconds. if you haven't found a good choice , you can have a try. best wishes.
that's easy,rich resource will show if you search on the internet with the key word of barcode generator . similarly, you can find resource about barcode reader too using the search engine .
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)