vCardLib is a powerful and flexible .NET library designed to simplify working with vCard (.vcf) files. Whether you're reading, writing, or manipulating contact information, vCardLib provides an easy-to-use API to handle vCard versions 2.1, 3.0, and 4.0 seamlessly. π
Perfect for applications dealing with contact management, address books, or any scenario where vCard files are used, vCardLib ensures your vCard processing is smooth and efficient. π
- Read Multiple Contacts: Parse multiple contacts from a single
.vcf
file, stream, or string. - Easy Iteration: Returns contact data as an
IEnumerable<vCard>
for effortless looping. - Cross-Version Support: Works with vCard versions 2.1, 3.0, and 4.0.
- Serialization and Deserialization: Easily convert between vCard objects and their string/file representations.
You can install vCardLib via NuGet using one of the following methods:
Install-Package vCardLib.dll
dotnet add package vCardLib.dll
string filePath = // path to .vcf file;
IEnumerable<vCard> contacts = vCardDeserializer.FromFile(filePath);
var stream = // generate stream containing serialized vCards
IEnumerable<vCard> contacts = vCardDeserializer.FromStream(stream);
var contactDetails = @"BEGIN:VCARD
VERSION:2.1
N:John;Doe;;;
END:VCARD";
IEnumerable<vCard> contacts = vCardDeserializer.FromContent(contactDetails);
var vcard = new vCard(vCardVersion.V2)
{
FormattedName = "John Doe"
};
var serialized = vCardSerializer.Serialize(vcard);
/*
Output:
BEGIN:VCARD
VERSION:2.1
REV:20230719T001838Z
FN:John Doe
END:VCARD
*/
var vcard = new vCard(vCardVersion.V2)
{
FormattedName = "John Doe"
};
var serialized = vCardSerializer.Serialize(vcard, vCardVersion.V4);
/*
Output:
BEGIN:VCARD
VERSION:4.0
REV:20230719T001838Z
FN:John Doe
END:VCARD
*/
-
master
: Contains the latest breaking changes and features. π§
Note: This branch may contain unstable code and is not recommended for production use. -
v4 Tag: The most recent stable release. β
A huge thank you to these amazing contributors who have helped make vCardLib better:
@bolorundurowb, @crowar,
@rmja, @JeanCollas
vCardLib is licensed under the MIT License. See the LICENSE file for more details.
Whether you're building a contact management system, integrating vCard support into your app, or just need to process .vcf
files, vCardLib is here to make your life easier. Install the package, follow the examples, and start working with vCards like a pro! β±οΈ
Happy Coding! π