结合使用Microsoft Outlook API和C#列出日历并添加事件 [英] Using Microsoft Outlook API with C# to list calendars and add events

查看:391
本文介绍了结合使用Microsoft Outlook API和C#列出日历并添加事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了一些有关如何使用REST API连接到Outlook帐户的Microsoft资源.他们提供的示例教程让我创建了WPF项目,并在Outlook Developer中心注册了应用.

I have found some Microsoft Resources about how to use the REST API to connect to an Outlook account. The sample tutorial they provided got me to create a WPF project and register an app with the Outlook Developer centre.

所以我已经完成了所有这些工作,并且可以连接到Outlook.它显示了内容屏幕,用户必须在其中允许访问.一切都很好.

So I have done all of that and can connect to Outlook. It shows the content screen where the user must allow access. All good.

但是我不想使用WPF.理想情况下,我想编写一个与Outlook API通信的C#.NET DLL组件,这样我就可以专门:

But I don't want to use WPF. Ideally I want to write a C# .NET DLL component what with communicate with the Outlook API so that I can specifically:

  • 列出日历
  • 将事件添加到日历
  • 从日历中删除事件

我了解我需要使用 Microsoft.Graph 库,但是我可以找不到如何在C#.NET中使用它.

I understand that I need to use the Microsoft.Graph library but I can't find out how to use this with C# .NET.

我熟悉Google Calendar API,并编写了 VB. NET 命令行实用程序,它执行相同的操作.所以我希望做类似的事情.

I am familiar with the Google Calendar API and have written a VB. NET command line utility that does the same things. So I was hoping to do things similarly.

WPF教程在连接"阶段停止,因此我对如何继续一无所知.另一个例子在这里:

The WPF tutorial stops at the "connect" stage so I am at a loss as to how to proceed. And the other example is here:

https://docs.microsoft.com/zh-CN /outlook/rest/dotnet-tutorial

这说明了如何使用 ASP.NET MVC Web应用程序编写实用程序以获取Outlook邮件,日历和联系人.但是再次,我对于如何使用C#.NET DLL进行操作感到困惑.

That shows you how to write a utility with ASP.NET MVC Web app to get Outlook mail, calendar, and contacts. But again, I am confused as to how to do what I want with C#.NET DLL.

如果可以使用C#DLL中的Microsoft.Graph库列出日历等.

If it is possible to using the Microsoft.Graph library from C# DLL to list the calendars etc. I would appreciate guidance.

如果有更直接的资源,我应该指出这个问题,那么我很乐意这样做.

If there is a more direct resource I should point this question to then I would be more than happy to do so.

谢谢.

PS.请注意,我指的是在线Outlook系统,而不是用户PC上的Microsoft Outlook.

PS. Please note that I am referring to the online Outlook system and not the Microsoft Outlook on a user PC.

推荐答案

有许多使用Microsoft Graph .NET SDK的C#示例 ConsoleApp-DeltaQuery-DotNet-Sample .

There are a number of C# examples using the Microsoft Graph .NET SDK available on GitHub. There is a Console App example included in that list: ConsoleApp-DeltaQuery-DotNet-Sample.

这篇关于结合使用Microsoft Outlook API和C#列出日历并添加事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆