Click here to Skip to main content
15,888,968 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
plz help me out sir for following coding

C#
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Drawing.Imaging;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Drawing;
using System.Collections.Generic;

using Bytescout.BarCodeReader;

namespace WebTestSharp
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void UploadButton_Click(object sender, EventArgs e)
        {
            String savePath = @"\uploads\";

            if (FileUpload1.HasFile)
            {
                String fileName = FileUpload1.FileName;
                savePath += fileName;
                FileUpload1.SaveAs(Server.MapPath(savePath));

                Reader barcodeReader = new Reader();

                // reader.MediumTrustLevelCompatible = true; // uncomment this line to enable Medium Trust compatible mode (slows down the recognition process as direct image data access is disabled in Medium Trust mode)
                UploadStatusLabel.Visible = false;

                ListBox1.Items.Clear();
                ListBox1.Visible = true;
                ListBox1.Items.Add("Reading barcode(s) from image #" + imgNum);

                FoundBarcode[] barcodes = barcodeReader.ReadFrom(savePath);

                if (barcodes.Length == 0)
                {
                    ListBox1.Items.Add("    No barcodes found");
                }
                else
                {
                    foreach (FoundBarcode barcode in barcodes)
                        ListBox1.Items.Add(String.Format("Found barcode with type '{0}' and value '{1}'", barcode.Type, barcode.Value));
                }

            }
            else
            {
                // Notify the user that a file was not uploaded.
                UploadStatusLabel.Text = "You did not specify a file to upload.";
            }
        }
    }
}
Posted
Comments
Blutfaust 11-Jul-15 18:53pm    
Maybe you should ask the author of the code.

http://bytescout.com/?q=/products/developer/barcodereadersdk/bytescoutbarcodereadersdk_asp_net_upload_image_and_read_barcode.html

1 solution

Since Bytescout is only mentioned in that code as part of the using statement:
C#
using Bytescout.BarCodeReader;
The chances are you have not added a reference to the assembly containing the class or namespace.

See here: MSDN: "How to: Add and Remove References in Visual Studio (C#)"[^]

[edit]typo[/edit]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900