1

我想从用户个人资料社交数据库中获取使用 SocialCommentControl 输入的评论。我尝试了托管 CSOM API 中的以下代码段,但未能成功。任何帮助将不胜感激。

    System.Net.NetworkCredential cred = new System.Net.NetworkCredential("domain\\useracc", "pass@word1");
ClientContext clientContext = new ClientContext("http://testsitecollection/"); clientContext.Credentials = cred;PersonProperties owner = new PeopleManager(clientContext).GetPropertiesFor("domain\\useracc");
MicrofeedManager mgr = new MicrofeedManager(clientContext); 
clientContext.Load(mgr, f => f.CurrentUser); 
clientContext.Load(owner); 
clientContext.ExecuteQuery();
MicrofeedRetrievalOptions optn = new MicrofeedRetrievalOptions(); 
optn.ContentOnly = true; 
optn.IncludedTypes = MicroBlogType.All; 
optn.ResultSortOrder = MicrofeedSortOrder.CreatedTime; 
optn.NewerThan = DateTime.Today.AddDays(-2);
ClientResult<MicrofeedThreadCollection> res = mgr.GetMyConsolidatedFeed(optn); 
clientContext.ExecuteQuery();
4

0 回答 0