当我使用Microsoft.SharePoint.Client(Sharepoint 2013客户端组件SDK)连接到sharepoint以检索我的配置文件属性时。我很惊讶地发现PersonProperties类的.UserProfileProperties成员是一个Dictionary< string,string>而不是字典< string,object>!
我遇到的问题是那里有字段值,我想得到的是字节数组,但因为值是一个字符串,所以我只能看到一段看起来像“System”的文本。字节[]”。公顷!
我是否有另一种方法可以从.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