Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/335.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在持续联系中,我必须再添加一个联系人列表_C#_Constantcontact - Fatal编程技术网

C# 在持续联系中,我必须再添加一个联系人列表

C# 在持续联系中,我必须再添加一个联系人列表,c#,constantcontact,C#,Constantcontact,我在特定列表中有一个联系人,我还想将其添加到另一个列表中。 下面的代码正在工作,但突然停止工作不知道为什么 我也没有得到任何错误。我在这里做错了什么 string[] emailAddress = new string[] { list[i].EmailAddress }; IList<Contact> myList = Utility.SearchContactByEmail(authenticationData, emailAddress, out nextChunkId); C

我在特定列表中有一个联系人,我还想将其添加到另一个列表中。
下面的代码正在工作,但突然停止工作不知道为什么

我也没有得到任何错误。我在这里做错了什么

string[] emailAddress = new string[] { list[i].EmailAddress };
IList<Contact> myList = Utility.SearchContactByEmail(authenticationData, emailAddress, out nextChunkId);
Contact thisContact =  Utility.GetContactDetailsById(authenticationData, myList[0].Id);

thisContact.Id = myList[0].Id;

ContactOptInList newList = new ContactOptInList();
newList.OptInSource = ContactOptSource.ActionByCustomer;
newList.ContactList = new ContactList("3");
//Contact list you want to add them to
thisContact.ContactLists.Add(newList);
string[]emailAddress=新字符串[]{list[i].emailAddress};
IList myList=Utility.SearchContactByEmail(身份验证数据、电子邮件地址、out nextChunkId);
Contact thisContact=Utility.GetContactDetailsById(authenticationData,myList[0].Id);
thisContact.Id=myList[0].Id;
ContactOptInList newList=新ContactOptInList();
newList.OptInSource=ContactOptSource.ActionByCustomer;
newList.ContactList=新联系人列表(“3”);
//要将其添加到的联系人列表
thisContact.ContactList.Add(新建列表);

什么是“停止工作”?预期/实际结果?它不会引发任何异常,也不会更新列表。您不应该调用类似于:
实用程序。UpdateContactSmallForm(AuthenticationData,thisContact)
?感谢您的回复Alex,我看不到方法UpdateContactSmallForm(),但有UpdateContactFullForm()通过使用它,我得到了一个错误,远程服务器返回了一个错误:(400)错误的请求。我发现,如果删除其中一个列表,constact中的这个实际列表顺序与列表的id不匹配。这就是为什么当我给id 3时,它会实际更新id为5的列表,因为中间的2个列表被删除。如果tyr 2我收到了错误的请求错误,因为带有该id的列表已被删除,这就是为什么我感到困惑的原因,希望这能帮助一些人。。