Last active
June 10, 2019 17:20
-
-
Save GroupDocsGists/44b809a3798c4aed596e63064bf5b40d to your computer and use it in GitHub Desktop.
Get Properties from vCard format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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