Events 将事件添加到Outlook中的自定义日历

Events 将事件添加到Outlook中的自定义日历,events,calendar,hotmail,Events,Calendar,Hotmail,如何使用Live SDK for.NET将enevt添加到outlook中的自定义日历?在文档中,您仅将事件添加到默认日历,而不是自定义日历 private async void btnCreateEvent_Click(object sender, RoutedEventArgs e) { try { var calEvent = new Dictionary<string, object>(); calEvent.A

如何使用Live SDK for.NET将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;
    }
}
private async void btnCreateEvent\u单击(对象发送方,RoutedEventArgs e)
{
尝试
{
var calEvent=新字典();
添加(“姓名”、“家庭晚餐”);
添加(“描述”,“与辛西娅的家人共进晚餐”);
calEvent.添加(“开始时间”,“2012-04-07T01:30:00-08:00”);
calEvent.添加(“结束时间”,“2012-04-07T03:00:00-08:00”);
calEvent.Add(“地址”,“Coho葡萄园和酒厂,华盛顿州雷德蒙德大街123号,19532”);
calEvent.Add(“is_all_day_event”,false);
calEvent.Add(“可用性”、“忙”);
添加(“可见性”、“公共”);
LiveConnectClient liveClient=新的LiveConnectClient(this.session);
LiveOperationResult operationResult=等待liveClient.PostAsync(“我/事件”,calEvent);
动态结果=操作结果。结果;
this.infoTextBlock.Text=string.Join(“,”创建的事件:”,result.name,“ID:”,result.ID);
}
捕获(LiveConnectException异常)
{
this.infoTextBlock.Text=“创建事件时出错:”+异常.Message;
}
}
我试图用日历id替换路径“我/事件”,但无效。

您说:

我试图用日历id替换路径“我/事件”,但没有 工作

你差一厘米就到了

您应该将
中的“我/事件”替换为
中的“日历ID/事件”

我问了这个问题,读了MSFT论坛后回答了这个问题