我在将数据库联系人同步到谷歌联系人时收到此错误。
“类型
的未处理异常'System.Net.WebException'发生在Google.GData.Client.dll“
中
并在newcontact.text
private void btn_synchronize_Click(object sender, EventArgs e)
{
RequestSettings rs = new RequestSettings("Synchronization", "abc@gmail.com", "123");
ContactsRequest cr = new ContactsRequest(rs);
Contact newContact = new Contact();
newContact.Title.Text = "Liz Doe";------in.text also show error
EMail primaryEmail = new EMail("liz@gmail.com");
primaryEmail.Primary = true;
primaryEmail.Rel = ContactsRelationships.IsWork;
newContact.Emails.Add(primaryEmail);
EMail secondaryEmail = new EMail("liz@a.com");
secondaryEmail.Rel = ContactsRelationships.IsHome;
//newEntry.Emails.Add(secondaryEmail);
PhoneNumber phoneNumber = new PhoneNumber("555-555-5555");
phoneNumber.Primary = true;
phoneNumber.Rel = ContactsRelationships.IsMobile;
newContact.Phonenumbers.Add(phoneNumber);
//PostalAddress postalAddress = new PostalAddress();
//postalAddress.Value = "123 somewhere lane";
//postalAddress.Primary = true;
//postalAddress.Rel = ContactsRelationships.IsHome;
//newContact.PostalAddresses.Add(postalAddress);
newContact.Content = "Contact information for Liz";
Uri feedUri = new Uri(ContactsQuery.CreateContactsUri("default"));
Contact createdContact = cr.Insert(feedUri, newContact);//----here i am getting this error
}
}