Skip to content

tameemansari/vCardLib

 
 

Repository files navigation

This project contains two sub projects

Build status Coverage Status Download VCF Reader NuGet Mono

VCF-Reader

This tool was developed because I recently lost my android phone but was blessed to have created a VCF backup of all my contacts. VCF Reader loads contacts from a vCard (VCF) file into a table which allows sorting and case insensitive searching. The table shows the Surname, the first name, one email address and two Phone numbers

vCardLib

This is the library that powers the VCF Reader. Unlike all other vCard libraries for .NET that I found, this library supports reading multiple contacts from a single vcf file and returns the contact objects in a vCardCollection. The library currently supports only vCard version 2.1 and 3.0 (will provide a curated list of properties soon), work on adding vCard 3.0 support is ongoing.

How to use the library:

First get this package from nuget via your package manager:

Install-Package vCardLib.dll

Then add this using command:

using vCardLib;

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

string filePath = //path to vcf file;

vCardCollection contacts = vCard.FromFile(filePath);

Or pass a StreamReader object to it:

StreamReader sr = //generate a streamreader somehow;
vCardCollection contacts = vCard.FromStreamReader(sr);

Iterate over the collection and pick the vCard objects:

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

complete documentation on github.io

About

A library and graphic tool for reading files in the vcard format

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 98.8%
  • Other 1.2%