https://github.com/detaysoft/vcardparser
https://github.com/detaysoft/vcardparser
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/detaysoft/vcardparser
- Owner: Detaysoft
- License: apache-2.0
- Created: 2023-10-16T13:38:39.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-29T11:25:49.000Z (almost 2 years ago)
- Last Synced: 2025-03-26T04:45:38.497Z (over 1 year ago)
- Language: C#
- Size: 30.3 KB
- Stars: 24
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# VCardParser
You can perform VCard decode and encode operations by using the contact class in the project.
The nuget packages is available [here](https://www.nuget.org/packages/VCardParser)
## How to use
* NuGet Command: **Install-Package VCardParser**
* Example
```C#
using VCardParser.Helpers;
using VCardParser.Models;
Contact contact = new Contact
{
FirstName = "FirstName",
LastName = "LastName",
FormattedName = "FirstName LastName",
Organization = "Company",
OrganizationPosition = "Team",
Title = "Title",
Photo = "base64foto",
Emails = new List
{
new EMail
{
Address = "email@mail.com",
Type = "Home"
},
new EMail
{
Address = "email2@mail.com",
Type = "Company"
},
},
Phones = new List
{
new Phone
{
Number = "01111111111",
Type = "Cell"
},
new Phone
{
Number = "+902222222222",
Type = "Company"
},
}
};
// encode contact model for creating vcard file
var encodedVCard = contact.EncodeVCard();
Console.WriteLine(encodedVCard);
// exporting vcf file
File.WriteAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "filename.vcf"), encodedVCard);
// decode vcard file from vcf file to contact model
encodedVCard.DecodeVCard();
```