0
我正在尝试使用Google.GData.Contacts Api在c#中将事件添加到Google Apps联系人。将事件插入到C#中的应用程序联系人#
When objwhen = new When();
String objwhen1 = (year + "-" + month + "-" + day);
var nowString = dt.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ");
IFormatProvider culture = new System.Globalization.CultureInfo("en-US", true);
DateTime dateVal = DateTime.ParseExact(objwhen1, "yyyy-MM-dd", null, System.Globalization.DateTimeStyles.None);
objwhen.StartTime = dt.ToUniversalTime();
string str = objwhen.StartTime.ToString();
newContact.ContactEntry.Events.Add(new Google.GData.Contacts.Event()
{
Relation = "anniversary",
When = objwhen,
Label = "Anniversary"
});
到这里没有错误或异常,但插入时接触
createdContact = contactRequest.Insert(feedUri, newContact);
它抛出异常: 执行的请求失败:https://www.google.com/m8/feeds/contacts/default/full
请建议solutin
我试过这个,但它不工作。 – Renuka
如果我尝试添加事件联系,然后只有它会抛出异常及其不ProtocolViolationException。 – Renuka