我正在開發我的Google日曆集成應用程序。當我將參加者添加到EventAttendee對象時,出現「對象未初始化」的錯誤。請檢查下面的代碼...在Google日曆活動中添加參加者
Event Entry = new Event();
Entry.Summary = MeetingName;
Entry.Description = MeetingDetails;
EventDateTime dt_Start = new EventDateTime();
dt_Start.DateTime = meeting.StartTime.ToString("yyyy-MM-ddThh:mm:ss.000Z");
Entry.Start = dt_Start;
EventDateTime dt_End = new EventDateTime();
dt_End.DateTime = meeting.EndTime.ToString("yyyy-MM-ddThh:mm:ss.000Z");
Entry.End = dt_End;
if (invitees != null)
{
foreach (Participant invitee in invitees)
{
String str = invitee.Email;
str = invitee.Name;
Entry.Attendees.Add(new EventAttendee()
{
Email = invitee.Email,
DisplayName = WEB.HttpUtility.HtmlDecode(invitee.Name),
ResponseStatus = "accepted",
Organizer=false,
Resource=false
});
}
}
的地方,我在做什麼「Entry.Attendees.Add(新EventAttendee()」在這一點上我得到的錯誤...
感謝您的答覆......甚至只指定電子郵件地址和顯示名稱後後,我得到了未初始化對象的相同問題。 eventatteendee的其他屬性是AdditionalGuest,Comment,Id,Optional,Self。那麼你能告訴我什麼是我需要指定的其他事情。 –
問題已解決..我在創建eventatteendeee的單獨對象後執行了相同的過程,結果工作正常。 –