0

当我使用 Microsoft.SharePoint.Client(Sharepoint 2013 客户端组件 SDK)连接到 sharepoint 以检索我的配置文件属性时。我很惊讶地看到 PersonProperties 类的 .UserProfileProperties 成员是 Dictionary<string, string> 而不是 Dictionary<string, object>!

我遇到的问题是那里有我想获得的字段值是字节数组,但是因为该值是一个字符串,所以我只能看到一段看起来像“System.Byte [] ”。哈!

有没有另一种方法可以从 .UserProfileProperties 集合中获取实际正确的值 - 而不是使用它的字符串表示形式?

谢谢!

var context = new ClientContext(url); 
context.Credentials = new SharePointOnlineCredentials(username, password);

var peopleManager = new PeopleManager(context);
var myProperties = peopleManager.GetMyProperties();
context.Load(myProperties, p => p.AccountName, p => p.Email, p => p.UserProfileProperties);
context.ExecuteQuery();

然后检查 myProperties.UserProfileProperties

4

0 回答 0