Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个网站集,我想将搜索中心值设置为与另一个网站集相同。网站集是用代码创建的,所以我需要能够在网站集创建后设置属性。
我怎样才能以编程方式做到这一点?
此设置存储在 SPWeb 对象的属性包中。您可以按如下方式更新它:
using (SPSite site = new SPSite("http://server/site")) using (SPWeb web = site.OpenWeb()) { web.AllProperties["SRCH_ENH_FTR_URL"] = "/searchcenter/pages"; web.Update(); }