开发者

c# library that extracts gmail,yahoomail and AOL contacts [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 5 years ago.

Improve this question

Is there any good c# library that extracts gmail,yahoomail and AOL contacts? Any suggestion...

I looked at Opencontacts.net and i used opencontacts.dll in my asp.net web application but i can't able to make it work... It shows an error 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.....

I did this,

OpenContactsNet.GmailExtract gm = new OpenContactsNet.GmailExtract();
NetworkCredential nw =new NetworkCredential("chendur.pa开发者_如何学JAVAndiya@gmail.com","***");
OpenContactsNet.MailContactList ml = new OpenContactsNet.MailContactList();
gm.Extract(nw, out ml);

I am in search of any other c# library which would do my needs....


I haven't seen a good one that works with all of them. Its fairly easy to consume the individual services individually as there is .net examples for all of them. I would probably consume them individually any ways and then maybe extract a common interface if possible so that other popular webmail services could be added as needed.

Yahoo: http://developer.yahoo.com/addressbook/

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

AOL: http://dev.aol.com/article/2007/integrating_openauth_into_aspnet

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


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);
   }
 }


You should add using 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'/>");
        }
    }
  }
}` 


This is the new link of Gmail contact import 2.0 for .Net developers


The missing "Utilities" assembly is located in the \Lib folder under the OpenContactsNet project download (OpenContactsNet\Lib\Utilites.dll).

However, I don't think it works that well anymore. This library is pretty outdated.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜