ByteScout QR Code SDK - C# - Convert vCard to QR Code - ByteScout

ByteScout QR Code SDK – C# – Convert vCard to QR Code

  • Home
  • /
  • Articles
  • /
  • ByteScout QR Code SDK – C# – Convert vCard to QR Code

How to convert vcard to QR code in C# using ByteScout QR Code

The tutorial below will demonstrate how to convert vcard to QR code in C#

We made thousands of pre-made source code pieces for easy implementation in your own programming projects. Want to convert vcard to QR code in your C# app? ByteScout QR Code is designed for it. ByteScout QR Code is QR Code barcode generator SDK with tunnable quality and features like QR Code embedded logo or images. Supports batch generation and specialized features like encoding of vCard and other structures inside QR Code barcodes.

C# code samples for C# developers help to speed up coding of your application when using ByteScout QR Code. Follow the instructions from the scratch to work and copy the C# code. Implementing C# application typically includes multiple stages of the software development so even if the functionality works please test it with your data and the production environment.

Trial version of ByteScout QR Code is available for free. Source code samples are included to help you with your C# app.

Try ByteScout QR Code today: Get 60 Day Free Trial or sign up for Web API

Program.cs
      
using System.Diagnostics; using System.Drawing.Imaging; using System.IO; using Bytescout.BarCode; using Thought.vCards; namespace GenerateVCardQRCode { /// <summary> /// This example demonstrates generation of QR Code encoded vCard. /// It uses vCard library by David Pinch: /// /// vCard Class Library for .NET (Version 0.4; LGPL license) /// Copyright (c) 2007-2009 David Pinch /// http://www.thoughtproject.com/Libraries/vCard/ /// /// </summary> class Program { static void Main(string[] args) { // Generate vCard vCard vCard = new vCard(); vCard.GivenName = "Forrest"; vCard.FamilyName = "Gump"; vCard.Organization = "Bubba Gump Shrimp Co."; vCard.Title = "Shrimp Man"; vCard.Phones.Add(new vCardPhone("(111) 555-1212", vCardPhoneTypes.Home)); vCard.EmailAddresses.Add(new vCardEmailAddress("forrestgump@example.com", vCardEmailAddressType.Internet)); vCardDeliveryAddress address = new vCardDeliveryAddress(); address.AddressType.Add(vCardDeliveryAddressTypes.Home); address.Street = "100 Waters Edge"; address.City = "Baytown"; address.Region = "LA"; address.PostalCode = "30314"; address.Country = "United States of America"; vCard.DeliveryAddresses.Add(address); // Save vCard data to string vCardStandardWriter writer = new vCardStandardWriter(); StringWriter stringWriter = new StringWriter(); writer.Write(vCard, stringWriter); // Create and activate Bytescout.Barcode.QRCode instance using (QRCode barcode = new QRCode("demo", "demo")) { // Set barcode value barcode.Value = stringWriter.ToString(); // Save barcode to image barcode.SaveImage("result.png", ImageFormat.Png); } // Open generated barcode image in default associated application Process.Start("result.png"); } } }

Try ByteScout QR Code today: 60 Day Free Trial (on-premise version) or sign up for Web API (on demand version)

packages.config
      
<?xml version="1.0" encoding="utf-8"?> <packages> <package id="Thought.vCards" version="1.0.9" targetFramework="net20" requireReinstallation="true" /> </packages>

Try ByteScout QR Code today: 60 Day Free Trial (on-premise version) or sign up for Web API (on demand version)

VIDEO

ON-PREMISE VERSION

Get 60 Day Free Trial or Visit ByteScout QR Code page

Explore ByteScout QR Code documentation

WEB API

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next