vCardLib.dll
4.0.4
See the version list below for details.
dotnet add package vCardLib.dll --version 4.0.4
NuGet\Install-Package vCardLib.dll -Version 4.0.4
<PackageReference Include="vCardLib.dll" Version="4.0.4" />
paket add vCardLib.dll --version 4.0.4
#r "nuget: vCardLib.dll, 4.0.4"
// Install vCardLib.dll as a Cake Addin #addin nuget:?package=vCardLib.dll&version=4.0.4 // Install vCardLib.dll as a Cake Tool #tool nuget:?package=vCardLib.dll&version=4.0.4
vCardLib
<br/>
NOTE: A major redesign is coming using current C# features and with stricter compliance with the RFC-6350 and RFC-2426 standards. feel free to check the massive-rewrite-v5 branch out
<br/>
This master
branch contains the latest changes and features (which may be breaking) to see the last major release (
v3) click here
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
Deserialize from a file
string filePath = // path to vcf file;
var contacts = Deserializer.FromFile(filePath);
Deserialize from a Stream
var stream = // generate stream containing serialized vcards
var contacts = Deserializer.FromStream(stream);
Deserialize from a string
var contactDetails = @"BEGIN:VCARD
VERSION:2.1
N:John;Doe;;;
END:VCARD";
var contacts = Deserializer.FromString(contactDetails);
All deserialization produces a vCardCollection
containing the successfully deserialized contact information that can be iterated over. Iterate over the contact collection and pick the vCard objects:
foreach(var contact in contacts)
{
Console.WriteLine(contact.FormattedName);
}
For Serialization
Serialize as string
var vcard = new vCard
{
Version = vCardVersion.V2,
FormattedName = "John Doe",
BirthPlace = "Antarctica",
Gender = GenderType.Other,
GivenName = "John",
MiddleName = "Adekunle",
FamilyName = "Doe"
};
var serialized = Serializer.Serialize(vcard);
/*
BEGIN:VCARD
VERSION:2.1
REV:20230719T001838Z
N:Doe;John;Adekunle;;
FN:John Doe
BIRTHPLACE:Antarctica
KIND:Individual
GENDER:Other
END:VCARD
*/
Serialize to a Stream
var ms = new MemoryStream();
var vcard = new vCard
{
Version = vCardVersion.V2,
FormattedName = "John Doe",
BirthPlace = "Antarctica",
Gender = GenderType.Other,
GivenName = "John",
MiddleName = "Adekunle",
FamilyName = "Doe"
};
await Serializer.SerializeToStream(vcard, ms);
There is support for serializing a collection of vCard
as well with overloads to the Serialize
and SerializeToStream
methods.
Contributors
A huge thank you to these wonderful people who took time to contribute to this project.
<br/>
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp1.0 was computed. netcoreapp1.1 was computed. netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard1.3 is compatible. netstandard1.4 was computed. netstandard1.5 was computed. netstandard1.6 was computed. netstandard2.0 was computed. netstandard2.1 was computed. |
.NET Framework | net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen30 was computed. tizen40 was computed. tizen60 was computed. |
Universal Windows Platform | uap was computed. uap10.0 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 1.3
- NETStandard.Library (>= 1.6.1)
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 |
---|---|---|
6.0.0 | 4,129 | 9/28/2024 |
5.0.2 | 231 | 9/21/2024 |
5.0.1 | 3,960 | 6/13/2024 |
5.0.0 | 2,010 | 2/15/2024 |
4.0.4 | 15,469 | 7/19/2023 |
4.0.3 | 12,552 | 6/26/2022 |
4.0.2 | 473 | 6/22/2022 |
4.0.1 | 1,697 | 1/3/2022 |
4.0.0 | 435 | 12/12/2021 |
3.0.5 | 341 | 1/3/2022 |
3.0.4 | 328 | 12/12/2021 |
3.0.3 | 1,933 | 11/28/2021 |
3.0.2 | 557 | 10/11/2021 |
3.0.1 | 7,579 | 7/4/2020 |
3.0.0 | 649 | 5/31/2020 |
2.2.6 | 1,168 | 8/23/2019 |
2.2.5 | 1,645 | 2/8/2018 |
2.2.4 | 1,023 | 1/1/2018 |
2.2.3 | 1,089 | 11/28/2017 |
2.2.2 | 1,393 | 8/10/2017 |
2.2.1 | 1,202 | 3/17/2017 |
2.2.0 | 1,186 | 2/26/2017 |
2.1.2 | 1,310 | 12/19/2016 |
2.1.1 | 1,060 | 12/14/2016 |
2.1.0 | 1,456 | 9/15/2016 |
2.0.0 | 1,120 | 6/11/2016 |
1.1.3 | 1,054 | 6/6/2016 |
1.1.2 | 1,033 | 6/1/2016 |
1.1.1 | 1,182 | 5/9/2016 |
1.1.0 | 1,321 | 4/27/2016 |
1.0.0 | 1,885 | 4/23/2016 |
- Add support for serializing to a stream