提取gmail,yahoomail和AOL联系人的c#库

时间:2010-06-09 03:47:01

标签: c# import email contacts

有没有好的c#库提取gmail,yahoomail和AOL联系人?任何建议......

我查看Opencontacts.net并在我的asp.net网络应用程序中使用了opencontacts.dll,但我无法使其正常工作......它显示错误Could not load file or assembly 'Utilities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. ....

我这样做了,

OpenContactsNet.GmailExtract gm = new OpenContactsNet.GmailExtract();
NetworkCredential nw =new NetworkCredential("chendur.pandiya@gmail.com","***");
OpenContactsNet.MailContactList ml = new OpenContactsNet.MailContactList();
gm.Extract(nw, out ml);

我正在寻找能够满足我需求的任何其他c#库....

5 个答案:

答案 0 :(得分:4)

我还没有看到一个适合所有人的好人。单独使用各个服务相当容易,因为所有这些服务都有.net示例。我可能会以任何方式单独使用它们,然后如果可能的话可能会提取一个通用接口,以便可以根据需要添加其他流行的webmail服务。

雅虎:http://developer.yahoo.com/addressbook/

Gmail:http://code.google.com/apis/contacts/docs/1.0/developers_guide_dotnet.html

美国在线:http://dev.aol.com/article/2007/integrating_openauth_into_aspnet

Hotmail:http://msdn.microsoft.com/en-us/library/bb463989.aspx

答案 1 :(得分:1)

RequestSettings rs = new RequestSettings(this.ApplicationName, this.userName, this.passWord);
 // AutoPaging results in automatic paging in order to retrieve all contacts
 rs.AutoPaging = true;
 ContactsRequest cr = new ContactsRequest(rs);

 Feed<Contact> f = cr.GetContacts();
 foreach (Contact e in f.Entries)
 {
   Console.WriteLine("\t" + e.Title);
   foreach (EMail email in e.Emails)
   {
      Console.WriteLine("\t" + email.Address);
   }
   foreach (GroupMembership g in e.GroupMembership)
   {
      Console.WriteLine("\t" + g.HRef);
   }
   foreach (IMAddress im in e.IMs)
   {
      Console.WriteLine("\t" + im.Address);
   }
 }

答案 2 :(得分:0)

您应该使用System.Net添加;

`using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
/*CREDENTIAL CLASS' NAMESPACE*/
using System.Net;
using OpenContactsNet;

namespace WebApplication1
{
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        OpenContactsNet.GmailExtract gm = new OpenContactsNet.GmailExtract();
        NetworkCredential nw = new NetworkCredential("tresorunikin@gmail.com", "titinik");
        OpenContactsNet.MailContactList ml = new OpenContactsNet.MailContactList();
        gm.Extract(nw, out ml);
//Triyng to Show somethin
        Response.Write(ml.Count+" Contacts : ");
        foreach(MailContact mc in ml){
            Response.Write(mc.Email+"<hr size='1'/>");
        }
    }
  }
}` 

答案 3 :(得分:0)

This是.Net开发人员的Gmail联系人导入2.0的新链接

答案 4 :(得分:0)

缺少的“Utilities”程序集位于OpenContactsNet项目下载(OpenContactsNet \ Lib \ Utilites.dll)下的\ Lib文件夹中。

然而,我认为它不再适用。这个库已经过时了。