我想用他們的個人資料照片檢索我的 Azure Active Directory 中的所有用戶。
我的請求是這樣的:
var photo = await _graphServiceClient.Users[userId].Photo.Content.Request().GetAsync()
我知道理論上可以定義所需的大小:Microsoft Graph API - Get profile picture with defined size
現在我想知道如何在 C# 中做到這一點。我知道對于團體來說,它實際上是這樣作業的:
var photo = await _graphServiceClient.Groups[groupId].Photos["64x64"].Content.Request().GetAsync()
如果我在用戶請求中使用括號,它會顯示“無法應用索引...”。
var photo = await _graphServiceClient.Users[userId].Photo["64x64"].Content.Request().GetAsync()
我希望有人能幫幫忙 :)
uj5u.com熱心網友回復:
也許你需要Photos不Photo
var photo = await _graphServiceClient.Users[userId].Photos["64x64"].Content.Request().GetAsync()
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/331417.html
上一篇:正整數的tryparse方法不會回傳輸入不是整數的錯誤
下一篇:ASP.NETCORE:嘗試激活“API.Controllers.UsersController”時無法決議“API.SQLConnection.IDBConnection”型別的服務
