如何使用适用于 .NET 的 Live SDK 将 enevt 添加到 Outlook 中的自定义日历中?在文档中,您仅将事件添加到默认日历,而不是自定义日历。
private async void btnCreateEvent_Click(object sender, RoutedEventArgs e)
{
try
{
var calEvent = new Dictionary<string, object>();
calEvent.Add("name", "Family Dinner");
calEvent.Add("description", "Dinner with Cynthia's family");
calEvent.Add("start_time", "2012-04-07T01:30:00-08:00");
calEvent.Add("end_time", "2012-04-07T03:00:00-08:00");
calEvent.Add("location", "Coho Vineyard and Winery, 123 Main St., Redmond WA 19532");
calEvent.Add("is_all_day_event", false);
calEvent.Add("availability", "busy");
calEvent.Add("visibility", "public");
LiveConnectClient liveClient = new LiveConnectClient(this.session);
LiveOperationResult operationResult = await liveClient.PostAsync("me/events", calEvent);
dynamic result = operationResult.Result;
this.infoTextBlock.Text = string.Join(" ", "Created event:", result.name, "ID:", result.id);
}
catch (LiveConnectException exception)
{
this.infoTextBlock.Text = "Error creating event: " + exception.Message;
}
}
我试图用日历 ID 替换路径"我/事件",但它不起作用。
你说:
我试图用日历 ID 替换路径"我/事件",但它没有 工作。
而你离你很近一厘米!!
您应该将"me/events"
替换为"CALENDAR_ID/events"
我在SO中问过这个问题后想到了这个问题,并在阅读了MSFT论坛后回答了这个问题