MSiH.MixERP.Net.VCards 1.1.0

dotnet add package MSiH.MixERP.Net.VCards --version 1.1.0                
NuGet\Install-Package MSiH.MixERP.Net.VCards -Version 1.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MSiH.MixERP.Net.VCards" Version="1.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MSiH.MixERP.Net.VCards --version 1.1.0                
#r "nuget: MSiH.MixERP.Net.VCards, 1.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MSiH.MixERP.Net.VCards as a Cake Addin
#addin nuget:?package=MSiH.MixERP.Net.VCards&version=1.1.0

// Install MSiH.MixERP.Net.VCards as a Cake Tool
#tool nuget:?package=MSiH.MixERP.Net.VCards&version=1.1.0                

MSiH.MixERP.Net.VCards

Fork of MixERP.Net.VCards upgrade to .net core 6 and fixes - VCards is a standard-compliant, lightweight, and forgiving vCard parser written in C# which supports parsing and serializing vCards. The following versions are supported:

  • Version 2.1
  • Version 3.0
  • Version 4.0

Change Log

  • Fix splitting group vCard file
  • Fix adding type=pref to token
  • Fix exception with malformed URI

How to Use this Library?

Download Nuget Package

Install-Package MSiH.MixERP.Net.VCards

Create a vCard

var vcard = new VCard
{
    Version = VCardVersion.V4,
    FormattedName = "John Doe",
    FirstName = "John",
    LastName = "Doe",
    Classification = ClassificationType.Confidential,
    Categories = new[] {"Friend", "Fella", "Amsterdam"},
    //...
};

Serialize a vCard and Save as a VCF File

string serialized = vcard.Serialize();
string path = Path.Combine("C:\", "JohnDoe.vcf");
File.WriteAllText(path, serialized);

Parse a VCF File

IEnumerable<VCard> vcards = MixERP.Net.VCards.Deserializer.Deserialize(path);

or

string contents = File.ReadAllText(path, Encoding.UTF8);
IEnumerable<VCard> vcards = MixERP.Net.VCards.Deserializer.GetVCards(contents);

foreach (var vcard in vcards)
{
    Console.WriteLine(vcard.FirstName + " \t " + vcard.MiddleName + " " + vcard.LastName);
    Console.WriteLine(vcard.FormattedName);
}
Console.ReadLine();

Supported V2 Features:

For more info, please see the specifications here

  • Formatted Name (FN string)
  • Last Name (N string)
  • First Name (N string)
  • Middle Name (N string)
  • Prefix (N string)
  • Suffix (N string)
  • BirthDay (BDAY string)
  • Addresses (ADR complex enumerable)
  • Delivery Address (LABEL complex)
  • Telephones (TEL complex enumerable)
  • Emails (EMAIL complex enumerable)
  • Mailer (MAILER string)
  • Title (TITLE string)
  • Role (ROLE string)
  • Time Zone (TITLE TimeZoneInfo)
  • Logo (LOGO string, Base64 Encoded)
  • Photo (PHOTO string, Base64 Encoded)
  • Note (NOTE string)
  • Last Revision (REV DateTime?)
  • Url (URL Uri)
  • Unique Identifier (UID string)
  • Version (VERSION enum)
  • Organization (ORG string)
  • Organizational Unit (ORG string)
  • Longitude (GEO double)
  • Latitude (GEO double)

Supported V3 Features:

For more info, please see the RFC 2426 specifications here

  • Nick Name (NICKNAME string)
  • Categories (CATEGORIES string[])
  • Sort String (SORT-STRING string)
  • Sound (SOUND string, Base64 Encoded)
  • Key (KEY string, Base64 Encoded)
  • Classification (CLASS enum)

Supported V4 Features:

For more info, please see the RFC 6350 specifications here

  • Source (SOURCE Uri)
  • Kind (KIND enum)
  • Anniversary (ANNIVERSARY DateTime?)
  • Gender (GENDER enum)
  • Impps (IMPP complex ienumerable)
  • Languages (LANG complex enumerable)
  • Relations (RELATED complex enumerable)
  • Calendar User Addresses (CALADRURI Uri enumerable)
  • Calendar Addresses (CALURI complex enumerable)
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 312 11/4/2023
1.0.1 119 11/4/2023

Fixed malformed URI