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 6634603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:56:57+00:00 2026-05-25T22:56:57+00:00

iam trying to write a class which imports *.vcf files (Vcard), because i didn´t

  • 0

iam trying to write a class which imports *.vcf files (Vcard), because i didn´t found a adequate .net class to solve that job.

So i decided to treat the *.vcf file like a *.txt file. I just import the whole file, line by line, with a StreamReader. Finally i save the line into a List object.

The Code:

 private List<string> vcardList = new List<String>();
    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        using (StreamReader reader = new StreamReader(@"H:\VS.vcf"))
        {
            string line;
            while ((line = reader.ReadLine()) != null)
            {
                vcardList.Add(line);
            }
        }
    }

After importing the text i needed to edit the lines, because i need to remove all the unnecessary symbols.
I tried to use the RedEx claa:

private void button1_Click(object sender, EventArgs e)
    {
        vcardList[0] = Regex.Replace(vcardList[0], "BEGIN:", string.Empty);          
    } 

that works very well, for the first line! but the *.vcf file is very complex and allways different.

So my question is: Is there a better way to solve that problem?

This is the *.vcf file:

BEGIN:VCARD
VERSION:2.1
N;LANGUAGE=de;CHARSET=Windows-1252:Test;Mustermann;;;(geschäftlich)
FN;CHARSET=Windows-1252:Test Mustermann (geschäftlich)
ORG:Mustermann CompanyTITLE;CHARSET=Windows-1252:CEO
TEL;WORK;VOICE:0049 1111 22 769 23 - 1
TEL;CELL;VOICE:0049 2222 33 71 55 90
ADR;WORK;PREF;CHARSET=Windows-1252:;;Frobuehl 22;Gothtown;;101092;England
LABEL;WORK;PREF;CHARSET=Windows-1252;ENCODING=QUOTED-PRINTABLE:Leihb=FChl 21=0D=0A=
101092 Frobuehl 
X-MS-OL-DEFAULT-POSTAL-ADDRESS:2
URL;HOME:www.Test-Mustermann.de
EMAIL;PREF;INTERNET:Test@Test-Mustermann.de
X-MS-OL-DESIGN;CHARSET=utf-8:<card 
END:VCARD

I only need the name and address. Thanks in advance

  • 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-25T22:56:58+00:00Added an answer on May 25, 2026 at 10:56 pm

    Pretty old, but it still works: https://github.com/drlongnecker/Thought.vCards

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

Sidebar

Related Questions

I am trying to write a container class which uses STL allocators. What I
I've got a .NET 3.5 class lib that I am trying to write some
I am trying to upload files using Java URL class and I have found
I am trying to write a database for class in which I read all
I am trying to write a Java class to extract a large zip file
I am trying to write a logger class for my C++ calculator, but I'm
I am trying to write operator overload for custom class and don't know how
I am trying to write a trivial Matrix class, using C++ templates in an
I am trying to write a generic module to extend the World class. I
I am trying to write an std::iterator for the CArray<Type,ArgType> MFC class. This is

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.