Skip to content

Satvik-web/VCard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VCard

This Package enables you to create contact cards..

This is a type of file ending with ".vcf"

You can easily create such files using this package..

I have given an implementation here.. But I would Strongly recommend visiting my blog for the detail explanation.. Link : https://satvikr.blogspot.com

Installing this package: Add this nuget package to your project.. Nuget page: https://www.nuget.org/packages/VCard/

Create a new Contact: Add the following namespaces to your project.. VCard.Models VCard.Helpers

Code to create a new contact:

Contact contact = new Contact
{
    FirstName = "Satvik",
    LastName = "Rajnarayanan",
    Addresses = new System.Collections.Generic.List<Address>()
    {
        new Address{Description="Example home address", Type="Home" }
    },
    Phones = new System.Collections.Generic.List<Phone>()
    {
        new Phone{Number="0000000000", Type="Home"}
    },
    Email = "someone@examplemail.com",
    FormattedName = "Satvik",
    Organization = "Nuget",
    Title = "Satvik"
};

To get the vcard use the following command:

FileHelper.CreateVCard(contact);

The following command will return a string.. So we can get it using the following command:

string contents = FileHelper.CreateVCard(contact);

Now we can use the string to create the physical file..

string contents = FileHelper.CreateVCard(contact);
File.WriteAllText("FileName.vcf", contents);

Please make sure that you use the file extention as vcf..

Support

All I have ever asked is to be active by submitting bugs, features and downloading this package..

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages