在 SharePoint 2010 中获取用户配置文件属性的术语集

发布于 2024-12-27 19:03:09 字数 61 浏览 3 评论 0原文

我需要(以编程方式)找出某个用户配置文件属性使用的术语集,但我不知道如何做到这一点。任何想法都受到高度赞赏!

I need to find out (programmatically) what term set is used by a certain user profile property, but I can't figure out how to do that. Any ideas are highly appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

黯淡〆 2025-01-03 19:03:09

最后,想通了:

SPSite site = new SPSite(url);
SPServiceContext context = SPServiceContext.GetContext(site);
var userProfileConfigManager = new UserProfileConfigManager(context);
ProfilePropertyManager profilePropertyManager = userProfileConfigManager.ProfilePropertyManager;
CorePropertyManager corePropertyManager = profilePropertyManager.GetCoreProperties();
CoreProperty property = corePropertyManager.GetPropertyByName(propertyName);
TermSet ts = property.TermSet; // DONE!

Finally, figured it out:

SPSite site = new SPSite(url);
SPServiceContext context = SPServiceContext.GetContext(site);
var userProfileConfigManager = new UserProfileConfigManager(context);
ProfilePropertyManager profilePropertyManager = userProfileConfigManager.ProfilePropertyManager;
CorePropertyManager corePropertyManager = profilePropertyManager.GetCoreProperties();
CoreProperty property = corePropertyManager.GetPropertyByName(propertyName);
TermSet ts = property.TermSet; // DONE!
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文