ByteScout Barcode Reader SDK - ASP.NET VB - Read Barcode - ByteScout

ByteScout Barcode Reader SDK – ASP.NET VB – Read Barcode

  • Home
  • /
  • Articles
  • /
  • ByteScout Barcode Reader SDK – ASP.NET VB – Read Barcode

How to read barcode in ASP.NET VB with ByteScout BarCode Reader SDK

This code in ASP.NET VB shows how to read barcode with this how to tutorial

The sample shows steps and algorithm of how to read barcode and how to make it work in your ASP.NET VB application. ByteScout BarCode Reader SDK is the SDK for barcode decoding. Can read all popular types from Code 128, GS1, UPC and Code 39 to QR Code, Datamatrix, PDF417. Images, pdf, TIF images and live web camera are supported as input. Designed to handle documents with noise and defects. Includes optional splitter and merger for pdf and tiff based on barcodes. Batch mode is optimized for high performance with multiple threads. Decoded values can be exported to XML, JSON, CSV or into custom data format and you can use it to read barcode with ASP.NET VB.

The SDK samples like this one below explain how to quickly make your application do read barcode in ASP.NET VB with the help of ByteScout BarCode Reader SDK. In order to implement the functionality, you should copy and paste this code for ASP.NET VB below into your code editor with your app, compile and run your application. Test ASP.NET VB sample code examples whether they respond your needs and requirements for the project.

Our website provides trial version of ByteScout BarCode Reader SDK for free. It also includes documentation and source code samples.

Try it today: Get 60 Day Free Trial or sign up for Web API

Default.aspx
      
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="SimpleWebTestVB._Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Simple Web Barcode Reader Tester (VB)</title> </head> <body> <form id="form1" runat="server"> <div> <div> <div> <br /> <asp:ListBox ID="ListBox1" runat="server"></asp:ListBox><br /> <br /> <asp:Image ID="Image1" runat="server" />&nbsp;</div> </div> </div> </form> </body> </html>

Try it today: Get 60 Day Free Trial or sign up for Web API

Default.aspx.designer.vb
      
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:2.0.50727.3053 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict Off Option Explicit On '''<summary> '''_Default class. '''</summary> '''<remarks> '''Auto-generated class. '''</remarks> Partial Public Class _Default '''<summary> '''form1 control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents form1 As Global.System.Web.UI.HtmlControls.HtmlForm '''<summary> '''ListBox1 control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents ListBox1 As Global.System.Web.UI.WebControls.ListBox '''<summary> '''Image1 control. '''</summary> '''<remarks> '''Auto-generated field. '''To modify move field declaration from designer file to code-behind file. '''</remarks> Protected WithEvents Image1 As Global.System.Web.UI.WebControls.Image End Class

Try it today: Get 60 Day Free Trial or sign up for Web API

Default.aspx.vb
      
Imports Bytescout.BarCodeReader Partial Public Class _Default Inherits Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Image1.ImageUrl = "BarcodePhoto.jpg" Dim reader As New Reader() ' Limit search to 1D barcodes only (exclude 2D barcodes to speed up the search). ' Change to reader.BarcodeTypesToFind.SetAll() to scan for all supported 1D and 2D barcodes ' or select specific type, e.g. reader.BarcodeTypesToFind.PDF417 = True reader.BarcodeTypesToFind.SetAll1D() '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) reader.ReadFromFile(Server.MapPath("BarcodePhoto.jpg")) For Each barcode As FoundBarcode In reader.FoundBarcodes ListBox1.Items.Add([String].Format("{0} : {1}", barcode.Type, barcode.Value)) Next End Sub End Class

Try it today: Get 60 Day Free Trial or sign up for Web API

SimpleWebTestVB.vbproj
      
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion> </ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{09E4ED77-92DA-4F6E-AC2E-358653FF2C9B}</ProjectGuid> <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids> <OutputType>Library</OutputType> <RootNamespace>SimpleWebTestVB</RootNamespace> <AssemblyName>SimpleWebTestVB</AssemblyName> <OldToolsVersion>4.0</OldToolsVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <FileUpgradeFlags> </FileUpgradeFlags> <UpgradeBackupLocation /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <DefineDebug>true</DefineDebug> <DefineTrace>true</DefineTrace> <OutputPath>bin\</OutputPath> <DocumentationFile>SimpleWebTestVB.xml</DocumentationFile> <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355</NoWarn> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <DefineDebug>false</DefineDebug> <DefineTrace>true</DefineTrace> <Optimize>true</Optimize> <OutputPath>bin\</OutputPath> <DocumentationFile>SimpleWebTestVB.xml</DocumentationFile> <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355</NoWarn> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release %28full%29|AnyCPU' "> <DefineTrace>true</DefineTrace> <OutputPath>bin\</OutputPath> <DocumentationFile>SimpleWebTestVB.xml</DocumentationFile> <Optimize>true</Optimize> <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355</NoWarn> <DebugType>pdbonly</DebugType> <PlatformTarget>AnyCPU</PlatformTarget> </PropertyGroup> <ItemGroup> <Reference Include="Bytescout.BarCodeReader, Version=8.20.0.1340, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>C:\Program Files\Bytescout BarCode Reader SDK\net4.00\Bytescout.BarCodeReader.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.Web" /> <Reference Include="System.Xml" /> <Reference Include="System.Configuration" /> <Reference Include="System.Web.Services" /> <Reference Include="System.EnterpriseServices" /> <Reference Include="System.Web.Mobile" /> </ItemGroup> <ItemGroup> <Import Include="Microsoft.VisualBasic" /> <Import Include="System" /> <Import Include="System.Collections" /> <Import Include="System.Collections.Generic" /> <Import Include="System.Data" /> <Import Include="System.Diagnostics" /> <Import Include="System.Collections.Specialized" /> <Import Include="System.Configuration" /> <Import Include="System.Text" /> <Import Include="System.Text.RegularExpressions" /> <Import Include="System.Web" /> <Import Include="System.Web.Caching" /> <Import Include="System.Web.SessionState" /> <Import Include="System.Web.Security" /> <Import Include="System.Web.Profile" /> <Import Include="System.Web.UI" /> <Import Include="System.Web.UI.WebControls" /> <Import Include="System.Web.UI.WebControls.WebParts" /> <Import Include="System.Web.UI.HtmlControls" /> </ItemGroup> <ItemGroup> <Content Include="BarcodePhoto.jpg" /> <Content Include="Default.aspx" /> <Content Include="Web.config" /> </ItemGroup> <ItemGroup> <Compile Include="Default.aspx.vb"> <SubType>ASPXCodeBehind</SubType> <DependentUpon>Default.aspx</DependentUpon> </Compile> <Compile Include="Default.aspx.designer.vb"> <DependentUpon>Default.aspx</DependentUpon> </Compile> <Compile Include="My Project\AssemblyInfo.vb" /> <Compile Include="My Project\Application.Designer.vb"> <AutoGen>True</AutoGen> <DependentUpon>Application.myapp</DependentUpon> </Compile> <Compile Include="My Project\Resources.Designer.vb"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> <DependentUpon>Resources.resx</DependentUpon> </Compile> <Compile Include="My Project\Settings.Designer.vb"> <AutoGen>True</AutoGen> <DependentUpon>Settings.settings</DependentUpon> <DesignTimeSharedInput>True</DesignTimeSharedInput> </Compile> </ItemGroup> <ItemGroup> <EmbeddedResource Include="My Project\Resources.resx"> <Generator>VbMyResourcesResXFileCodeGenerator</Generator> <LastGenOutput>Resources.Designer.vb</LastGenOutput> <CustomToolNamespace>My.Resources</CustomToolNamespace> <SubType>Designer</SubType> </EmbeddedResource> </ItemGroup> <ItemGroup> <None Include="My Project\Application.myapp"> <Generator>MyApplicationCodeGenerator</Generator> <LastGenOutput>Application.Designer.vb</LastGenOutput> </None> <None Include="My Project\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> <CustomToolNamespace>My</CustomToolNamespace> <LastGenOutput>Settings.Designer.vb</LastGenOutput> </None> </ItemGroup> <PropertyGroup> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> </PropertyGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> <ProjectExtensions> <VisualStudio> <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> <WebProjectProperties> <UseIIS>False</UseIIS> <AutoAssignPort>True</AutoAssignPort> <DevelopmentServerPort>49250</DevelopmentServerPort> <DevelopmentServerVPath>/</DevelopmentServerVPath> <IISUrl> </IISUrl> <NTLMAuthentication>False</NTLMAuthentication> <UseCustomServer>False</UseCustomServer> <CustomServerUrl> </CustomServerUrl> <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> </WebProjectProperties> </FlavorProperties> </VisualStudio> </ProjectExtensions> </Project>

Try it today: Get 60 Day Free Trial or sign up for Web API

Web.config
      
<?xml version="1.0"?> <configuration> <appSettings/> <connectionStrings/> <system.web> <!-- Set compilation debug="true" to insert debugging symbols into the compiled page. Because this affects performance, set this value to true only during development. Visual Basic options: Set strict="true" to disallow all data type conversions where data loss can occur. Set explicit="true" to force declaration of all variables. --> <compilation debug="true" strict="false" explicit="true" /> <pages> <namespaces> <clear /> <add namespace="System" /> <add namespace="System.Collections" /> <add namespace="System.Collections.Specialized" /> <add namespace="System.Configuration" /> <add namespace="System.Text" /> <add namespace="System.Text.RegularExpressions" /> <add namespace="System.Web" /> <add namespace="System.Web.Caching" /> <add namespace="System.Web.SessionState" /> <add namespace="System.Web.Security" /> <add namespace="System.Web.Profile" /> <add namespace="System.Web.UI" /> <add namespace="System.Web.UI.WebControls" /> <add namespace="System.Web.UI.WebControls.WebParts" /> <add namespace="System.Web.UI.HtmlControls" /> </namespaces> </pages> <!-- The <authentication> section enables configuration of the security authentication mode used by ASP.NET to identify an incoming user. --> <authentication mode="Windows" /> <!-- The <customErrors> section enables configuration of what to do if/when an unhandled error occurs during the execution of a request. Specifically, it enables developers to configure html error pages to be displayed in place of a error stack trace. <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="FileNotFound.htm" /> </customErrors> --> </system.web> </configuration>

Try it today: Get 60 Day Free Trial or sign up for Web API

MORE INFORMATION

Get 60 Day Free Trial or Visit ByteScout BarCode Reader SDK page

Explore ByteScout BarCode Reader SDK documentation

WEB API VERSION

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next