提取 gmail、yahoomail 和 AOL 联系人的 C# 库

发布于 2024-09-04 10:15:13 字数 1539 浏览 3 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

舟遥客 2024-09-11 10:15:13

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

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

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

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

不乱于心 2024-09-11 10:15:13
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);
   }
 }
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);
   }
 }
甚是思念 2024-09-11 10:15:13

您应该使用 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'/>");
        }
    }
  }
}` 

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("[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'/>");
        }
    }
  }
}` 
孤独患者 2024-09-11 10:15:13

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

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

空气里的味道 2024-09-11 10:15:13

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

然而,我认为它不再那么有效了。这个图书馆相当过时了。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文