如何以编程方式检索 SharePoint 我的网站用户使用 C# 的博客文章?
我设法访问用户个人资料内容:
using (SPSite ospSite = new SPSite("http://localhost:80/"))
{
ServerContext s = ServerContext.GetContext(ospSite);
UserProfileManager profileManager = new UserProfileManager(s);
UserProfile p = profileManager.GetUserProfile("some_user");
// e.g. responsibility retrieval
var r = p["SPS-Responsibility"];
var responsibilities = r.GetTaxonomyTerms();
}
但我不知道如何访问用户的博客帖子集合。
有什么建议吗?
I managed to access user profile content:
using (SPSite ospSite = new SPSite("http://localhost:80/"))
{
ServerContext s = ServerContext.GetContext(ospSite);
UserProfileManager profileManager = new UserProfileManager(s);
UserProfile p = profileManager.GetUserProfile("some_user");
// e.g. responsibility retrieval
var r = p["SPS-Responsibility"];
var responsibilities = r.GetTaxonomyTerms();
}
But I don't know how to access users' blog posts collection.
Any advice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
UserProfile
对象的PersonalSite
属性检索用户的“我的网站”。在 SPSite 循环中,子 SPWeb 对象是模板“Blog”。在此处查看模板名称:
http://blogs.msdn.com/b/richin/archive/2011/07/04/sharepoint-2010-site-template-names.aspx
一旦您找到博客站点后,您可以简单地访问SPWeb 对象的“Posts”列表中的项目。
Use the
PersonalSite
property ofUserProfile
object to retrieve the user's My Site.In the SPSite loop through, child SPWeb objects which are of template "Blog". Check out the templates names here:
http://blogs.msdn.com/b/richin/archive/2011/07/04/sharepoint-2010-site-template-names.aspx
Once you find the blog site, you can simply access the items in "Posts" List of the SPWeb object.