如何以编程方式区分 WSS 和 MOSS
我需要知道在使用 SP API 时我是否正在使用 SharePoint Services 或 SharePoint Portal Server。 有没有办法在代码(C#)中做到这一点?
I need to know if I am working with SharePoint Services or SharePoint Portal Server when using the SP API. Is there a way to do this in code (C#)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用 SPFarm.BuildVersion 检查构建版本是否不同:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spfarm.buildversion.aspx
You can check to see if the build version is different using SPFarm.BuildVersion:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spfarm.buildversion.aspx
查看 Karine Bosch 的博客文章 “确定是否安装了 MOSS通过检查注册表项”。 这应该有帮助。
Check out Karine Bosch's blog post "Determine if MOSS is installed by checking the Registry key". This should help.
请记住,即使服务器上安装了 MOSS,也很可能只为您的代码必须处理的网站/网站集激活 WSS 功能。 因此,另一种方法是检查服务器上是否有某些 MOSS 特定功能可用,甚至可能检查它们是否已被激活。 一个不错的候选者是发布功能,它仅随 MOSS 一起提供。
Remember that even though MOSS is installed on the server, it might very well be that only WSS features are activated for the sites / site collections your code has to work on. So an alternative way would be to check if certain MOSS specific features are available on the server AND maybe even check if they have been activated. A good candidate would be the Publishing Feature, which only comes with MOSS.