Skip to content

mirror222/vCardLib

 
 

Repository files navigation

vCardLib

Build status Coverage Status NET Standard NuGet Badge License: MIT

Documentation can be found at documentation site

T this library supports reading multiple contacts from a single vcf file, a stream or a contact string and returns the contact objects in a List. The library currently supports only vCard version 2.1 and 3.0 (a curated list of properties supported can be seen on the documentation site).

How to use the library:

First get this package from nuget via your package manager:

Install-Package vCardLib.dll

or

dotnet add package vCardLib.dll

For Deserialization

Import the namespaces:

using vCardLib.Deserializers;

In your class you call the static method 'FromFile' and pass a string containing a path to it:

string filePath = //path to vcf file;

var contacts = Deserializer.FromFile(filePath);

Or read your contacts from a Stream:

var stream = //generate a stream somehow;
var contacts = Deserializer.FromStream(stream);

Or read your contacts from a string:

var contactDetails = @"BEGIN:VCARD
N:John;Doe;;;
END:VCARD";
var contacts = Deserializer.FromString(contactDetails);

Iterate over the contact collection and pick the vCard objects:

foreach(var contact in contacts)
{
  Console.WriteLine(contact.FormattedName);
}

complete documentation on github.io

About

A .NET standard library for reading vCard files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%