C# 來取得365 Outlook相關資訊,使用 Microsoft.Graph 讀取 帳號、帳號管理者、行事曆、行事曆事件等資訊
在學習此操作之前先準備了解一下相關資訊及學習資源 線上API範本 https://developer.microsoft.com/en-us/graph/graph-explorer 線上操作文件 https://learn.microsoft.com/en-us/graph/overview?view=graph-rest-1.0 https://learn.microsoft.com/zh-cn/graph/overview 基本上我們必須先準備好下列4個數據資訊 string clientId = "應用程式 (用戶端) 識別碼" ; string authority = "目錄 (租用戶) 識別碼" ; string account = "Office 365 使用者的電子郵件信箱" ; string password = "Office 365 使用者的密碼" ; clientId = "應用程式 (用戶端) 識別碼" authority = "目錄 (租用戶) 識別碼" 操作權限的開啟 權限開放 /// <summary> /// 取得授權 /// </summary> /// <returns></returns> static async Task<AuthenticationResult> GetAuth() { string[] scopes = new string[] { "user.read", "Calendars.ReadBasic" }; IPublicClientApplication app; app = PublicClientApplicationBuilder.Create(clientId) .WithAuthority($"https://login.microsoftonline.com/{authority}") .Build(); AuthenticationResult result = null; try { // 使用...