在WebPart中获取Office 365中的未读邮件数

// Create the web request
HttpWebRequest request
  = WebRequest.Create("https://outlook.office365.com/api/v1.0/me/messages/$count?$filter=IsRead%20eq%20false") as HttpWebRequest; // Add authentication to request
request.Credentials = new NetworkCredential("username", "password"); // Get response
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
// Get the response stream
StreamReader reader = new StreamReader(response.GetResponseStream()); // 显示在前台控件中
unreadCount.Text = reader.ReadToEnd();
}
上一篇:利用python进行数据分析--(阅读笔记一)


下一篇:关于IOS浏览器:document,body的click事件触发规则