[英]How to retrieve Logged user image from SharePoint server?
我需要檢索Windows登錄用戶的圖像。
我檢查發現該圖像可以在SharePoint2010服務器中找到。
如何使用ASP.NET檢索此圖像?
如果您的Web應用程序與SharePoint位於同一服務器上,則可以使用服務器對象模型。 嘗試使用UserProfileManager類
像這樣:
var objUserProfileManager = new UserProfileManager(PortalContext.Current);
//get current users profile
var profile = objUserProfileManager.GetUserProfile();
//get user image URL
var imageUrl = (string)profile[PropertyConstants.PictureUrl][0];
我要說的是-您需要驗證運行Web應用程序的帳戶是否具有對SharePoint的適當權限,以對服務器對象模型進行調用。
編輯:如果您正在尋找Web服務方法,則可以使用sharepoint useprofile Web服務。
http://msdn.microsoft.com/zh-CN/library/aa981571(v=office.12).aspx
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.