ByteScout Barcode Reader SDK - C# - Read vCard from QR Code - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout Barcode Reader SDK – C# – Read vCard from QR Code

  • Home
  • /
  • Articles
  • /
  • ByteScout Barcode Reader SDK – C# – Read vCard from QR Code

How to read vcard from QR code in C# and ByteScout BarCode Reader SDK

This code in C# shows how to read vcard from QR code with this how to tutorial

On this page you will learn from code samples for programming in C#.Writing of the code to read vcard from QR code in C# can be done by developers of any level using ByteScout BarCode Reader SDK. ByteScout BarCode Reader SDK is the SDK for reading of barcodes from PDF, images and live camera or video. Almost every common type like Code 39, Code 128, GS1, UPC, QR Code, Datamatrix, PDF417 and many others are supported. Supports noisy and defective images and docs. Includes optional documents splitter and merger for pdf and tiff based on found barcodess. Batch mode is supported for superior performance using multiple threads. Decoded values are easily exported to JSON, CSV, XML and to custom format. It can be used to read vcard from QR code using C#.

You will save a lot of time on writing and testing code as you may just take the C# code from ByteScout BarCode Reader SDK for read vcard from QR code below and use it in your application. This C# sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Enjoy writing a code with ready-to-use sample codes in C#.

You can download free trial version of ByteScout BarCode Reader SDK from our website to see and try many others source code samples for C#.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.cs
      
using System; using System.IO; using Bytescout.BarCodeReader; using Thought.vCards; namespace ReadVCardFromQRCode { /// <summary> /// This example demonstrates reading 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) { // Create Bytescout.BarCodeReader.Reader instance using (Reader reader = new Reader()) { // Enable QR Code decoding reader.BarcodeTypesToFind.QRCode = true; /* ----------------------------------------------------------------------- NOTE: We can read barcodes from specific page to increase performance. For sample please refer to "Decoding barcodes from PDF by pages" program. ----------------------------------------------------------------------- */ // Decode QR Code from image FoundBarcode[] barcodes = reader.ReadFrom("sample_vcard.gif"); if (barcodes.Length > 0) { FoundBarcode vcardBarcode = barcodes[0]; // Decode vCard information from barcode value StringReader stringReader = new StringReader(vcardBarcode.Value); vCard vCard = new vCard(stringReader); // Display some decoded info: Console.WriteLine("GivenName: " + vCard.GivenName); Console.WriteLine("FamilyName: " + vCard.FamilyName); Console.WriteLine("Organization: " + vCard.Organization); Console.WriteLine("Title: " + vCard.Title); Console.WriteLine("Phone: " + vCard.Phones[0].FullNumber); Console.WriteLine("EmailAddresses: " + vCard.EmailAddresses[0]); Console.WriteLine("DeliveryAddress: " + vCard.DeliveryAddresses[0].Street + " " + vCard.DeliveryAddresses[0].City + " " + vCard.DeliveryAddresses[0].Region + " " + vCard.DeliveryAddresses[0].PostalCode + " " + vCard.DeliveryAddresses[0].Country); } } Console.WriteLine(); Console.WriteLine("Press any key..."); Console.ReadKey(); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout BarCode Reader SDK Home Page

Explore ByteScout BarCode Reader SDK Documentation

Explore Samples

Sign Up for ByteScout BarCode Reader SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout BarCode Reader SDK Home Page

Explore ByteScout BarCode Reader SDK Documentation

Explore Samples

Sign Up for ByteScout BarCode Reader SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next