VCF Vcard import c#

佐手、 提交于 2019-12-06 16:29:42
jgauffin

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

You can try to use this sample.

Helle, sry for the long delay.

I solved my problem now with the follwing code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Outlook = Microsoft.Office.Interop.Outlook;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
    public Form1()
{
InitializeComponent();
}

    private void Form1_Load(object sender, EventArgs e)
   {
        Outlook.ContactItem contact;
        Outlook.Application app = new Outlook.Application();

        contact = (Outlook.ContactItem)app.Session.OpenSharedItem(@"C:\vv.vfc");
        MessageBox.Show(contact.FirstName);
    }
   }
 }

This is just an example of how to easily import a VCF file with C# . i hope this helps. Of course i wouldnt implement it in that way, i rather would create a method with a parameter "incomingFile" or smth else.

Berry

the solution with the outlook application is not effictive.

Outlook.Application app = new Outlook.Application();

this will open the outlook first. and actually you need only to open the vcard and parse it to extract the information you want from it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!