Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6572365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:59:45+00:00 2026-05-25T14:59:45+00:00

I have a class to hold data and a list of that class. Here

  • 0

I have a class to hold data and a list of that class.
Here is my code.

static void Main(string[] args)
    {
        List<GoogleContacts> contacts = new List<GoogleContacts>();
        contacts.Add(new GoogleContacts { title = "A", email = "B", im = "X" });
        contacts.Add(new GoogleContacts { title = "C", email = "D", im = "Y" });
        contacts.Add(new GoogleContacts { title = "E", email = "F", im = "Z" });
    }
}


public class GoogleContacts
{
    public string title { get; set; }
    public string email { get; set; }
    public string im { get; set; }
}

I want to save those data in a .VCF file in local Disk.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:59:46+00:00Added an answer on May 25, 2026 at 2:59 pm

    Just create a StringBuilder instance and write the contents of the .VCF to it.

    var contact = new GoogleContacts() { ... };
    
    var vcf = new StringBuilder();
    vcf.Append("TITLE:" + contact.Title + System.Environment.NewLine); 
    //...
    

    Afterwards you can save it to a file using the static WriteAllText(…) method of the File type.

    var filename = @"C:\mycontact.vcf";
    File.WriteAllText(filename, vcf.ToString());
    

    Just open a .vcf file with a text editor to explore its contents. Since you only require a couple of properties it should be easy to figure out.

    A small example:

    BEGIN:VCARD
    FN:Mr. John Smith
    TITLE:Developer
    ORG:Microsoft
    BDAY:1979-12-10
    VERSION:2.1
    END:VCARD
    

    If you want to include an image you have to base 64 encode it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a container class which uses boost::optional to hold the value. Here is
I have a timeseries class that, over the course of a day will hold
I have class method that returns a list of employees that I can iterate
I have a class called Shop that contains data members ( NSString , NSInteger
I have a data.frame , called so_data. Columns 13:23 are list s, which hold
I have a self made data structure (for example linked list) that works well,
I have created a class for a dashboard item which will hold information such
I have an object, c , of type Class (I get hold of the
I have a box of selectors all sharing the class. widgetContainer can hold 3
I have class like below template<class T> class Student { public: static Student& Instance();

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.