2010-06-09 47 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); 
    } 
}