Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Last active June 10, 2019 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/44b809a3798c4aed596e63064bf5b40d to your computer and use it in GitHub Desktop.
Save GroupDocsGists/44b809a3798c4aed596e63064bf5b40d to your computer and use it in GitHub Desktop.
Get Properties from vCard format
// For complete examples and data files, please go to https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-.NET
using (VCardFormat format = new VCardFormat(@"D:\input.vcf"))
{
foreach (VCardMetadata vCard in format.VCardInfo)
{
Console.WriteLine(vCard.IdentificationRecordset.Name);
PrintArray(vCard.IdentificationRecordset.FormattedNames);
PrintArray(vCard.CommunicationRecordset.Emails);
PrintArray(vCard.CommunicationRecordset.Telephones);
}
}
...
...
private static void PrintArray(string[] values)
{
if (values != null)
{
foreach (string value in values)
{
Console.WriteLine(value);
}
}
}
// For complete examples and data files, please go to https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-Java
try (VCardFormat format = new VCardFormat("D:\\input.vcf"))
{
for (VCardMetadata vCard : format.getVCardInfo())
{
System.out.println(vCard.getIdentificationRecordset().getName());
printArray(vCard.getIdentificationRecordset().getFormattedNames());
printArray(vCard.getCommunicationRecordset().getEmails());
printArray(vCard.getCommunicationRecordset().getTelephones());
}
}
...
...
private static void printArray(String[] values)
{
if (values != null)
{
for (String value : values)
{
System.out.println(value);
}
}
}
// For complete examples and data files, please go to https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-.NET
// Apply your metered license
Metered metered = new Metered();
metered.SetMeteredKey("PublicKey", "PrivateKey");
//..
// Use the API features such as getting metadata etc.
//..
// Check credit consumption
var credits = Metered.GetConsumptionCredit();
// For complete examples and data files, please go to https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-Java
// Apply your metered license
Metered metered = new Metered();
metered.setMeteredKey("PublicKey", "PrivateKey");
//..
// Use the API features such as getting metadata etc.
//..
// Check credit consumption
double credits = Metered.getConsumptionCredit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment