0

我正在尝试使用 Utility.searchbyemail 选项检查联系人是否存在。

示例:IList myList = Utility.SearchContactByEmail(authdata, emailAddress, out nextChunkId);

上述语句引发错误:错误无法将类型“System.Collections.Generic.IList”隐式转换为“System.Collections.Generic.IList”。存在显式转换(您是否缺少演员表?)

任何帮助深表感谢。下面是我的参考代码,我希望我有所有的命名空间。

enter code here
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using ConstantContactBO;
using ConstantContactUtility;
using System.Data;
using System.Data.SqlClient;

namespace WebApplication4
{
public partial class WebForm1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ConstantContactBO.Contact c = new ConstantContactBO.Contact();
        c.EmailAddress = "";
        AuthenticationData authdata = new AuthenticationData();
        authdata.Username = "";
        authdata.Password = "";
        authdata.ApiKey = "";

        // get user Contact List collection
        string nextChunkId;
        string currentChunk;
        string x = "a@abc.com";
        string[] emailAddress = new string[]{x.Trim()};
        IList<ContactList> lists = Utility.GetUserContactListCollection(authdata, out nextChunkId);
        **IList<Contact> myList = Utility.SearchContactByEmail(authdata, emailAddress, out nextChunkId);** //Throws Error here
    }
}
}
4

1 回答 1

0

我解决了。问题在于使用命名空间 WebApplication4。

于 2012-11-13T22:12:59.223 回答