ByteScout QR Code SDK - C# - Create Simple QR Code - ByteScout

ByteScout QR Code SDK – C# – Create Simple QR Code

  • Home
  • /
  • Articles
  • /
  • ByteScout QR Code SDK – C# – Create Simple QR Code

How to create simple QR code in C# with ByteScout QR Code

The tutorial below will demonstrate how to create simple QR code in C#

These sample source codes on this page below are demonstrating how to create simple QR code in C#. ByteScout QR Code can create simple QR code. It can be used from C#. ByteScout QR Code is QR Code generation library. It provides full control on the quality, features and encoding. Can embed logo image right into QR Code itself. Batch barcode generation, and many special features like vCard or URL encoding are also supported.

This code snippet below for ByteScout QR Code works best when you need to quickly create simple QR code in your C# application. Follow the instructions from the scratch to work and copy the C# code. Use of ByteScout QR Code in C# is also explained in the documentation included along with the product.

Free trial version of ByteScout QR Code is available on our website. Documentation and source code samples are included.

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

GeneralExample.csproj
      
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion> </ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{A657F388-7D2A-4C05-9E04-6F6FAFF16F0C}</ProjectGuid> <OutputType>Exe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>GeneralExample</RootNamespace> <AssemblyName>GeneralExample</AssemblyName> <OldToolsVersion>3.5</OldToolsVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> <Reference Include="Bytescout.BarCode.QRCode, Version=1.0.0.100, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>c:\Program Files\Bytescout QR Code SDK\net40\Bytescout.BarCode.QRCode.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> </ItemGroup> <ItemGroup> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- 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> --> </Project>

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

GeneralExample.sln
      
Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeneralExample", "GeneralExample.csproj", "{A657F388-7D2A-4C05-9E04-6F6FAFF16F0C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {A657F388-7D2A-4C05-9E04-6F6FAFF16F0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A657F388-7D2A-4C05-9E04-6F6FAFF16F0C}.Debug|Any CPU.Build.0 = Debug|Any CPU {A657F388-7D2A-4C05-9E04-6F6FAFF16F0C}.Release|Any CPU.ActiveCfg = Release|Any CPU {A657F388-7D2A-4C05-9E04-6F6FAFF16F0C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

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

Program.cs
      
using System.Diagnostics; using Bytescout.BarCode; namespace GeneralExample { class Program { static void Main(string[] args) { // Create and activate QRCode instance using (QRCode barcode = new QRCode()) { barcode.RegistrationName = "demo"; barcode.RegistrationKey = "demo"; // Set value barcode.Value = "ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 1234567890"; // Uncomment if you don't need margins //barcode.Margins = new Margins(0, 0, 0, 0); //barcode.DrawQuietZones = false; // Save barcode image to file barcode.SaveImage("result.png"); } // Open the image in default image viewer (for demo purpose) Process.Start("result.png"); } } }

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

MORE INFORMATION

Get 60 Day Free Trial or Visit ByteScout QR Code page

Explore ByteScout QR Code documentation

WEB API VERSION

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next