2010-06-09 73 views
1

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

我看了看Opencontacts.net,我在我的asp.net web应用所使用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("[email protected]","***"); 
OpenContactsNet.MailContactList ml = new OpenContactsNet.MailContactList(); 
gm.Extract(nw, out ml); 

我在寻找任何其他C#库,它会做我需要的....

回答

4

我还没有看到一个好的与所有这些工作。它很容易单独使用各个服务,因为它们都是.NET的例子。如果可能的话,我可能会单独使用它们,然后可能会提取一个通用接口,以便可以根据需要添加其他常用的Webmail服务。

雅虎: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

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("[email protected]", "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'/>"); 
     } 
    } 
    } 
}` 
0

丢失的 “实用工具” 汇编位于OpenContactsNet项目下载(OpenContactsNet \ LIB \ UTILITES下的\ lib文件夹中的新链接。 DLL)。

但是,我认为它不再那么成功。这个库很不合时宜。

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); 
    } 
} 
相关问题