SharePoint 2013
我的代码:
SPWebService webService = SPFarm.Local.Services[webServiceGuid]
as SPWebService;
SPWebApplication webApp = webService.WebApplications[webApplicationGuid];
// path is "http://sharepoint2013/sites/sandbox2" string
SPSite siteCollection = webApp.Sites.Add(path, "root",
"abcdef@gmail.com");
siteCollection.RootWeb.Title = "My some sites collection";
siteCollection.RootWeb.Update();
我的网站集已成功创建,但是当我打开http://sharepoint2013/sites/sandbox2页面时,我看不到Title
的更新值。为什么会这样?
答案 0 :(得分:0)
如果您的SP安装的语言很少,则可能会出现问题。尝试类似:
SPWebService webService = SPFarm.Local.Services[webServiceGuid]
as SPWebService;
SPWebApplication webApp = webService.WebApplications[webApplicationGuid];
SPSite siteCollection = webApp.Sites.Add(ObjectPath, "root", "abcdef@gmail.com");
SPUserResource userResource = siteCollection.RootWeb.TitleResource;
foreach(CultureInfo culture in siteCollection.RootWeb.SupportedUICultures)
userResource.SetValueForUICulture(culture, "My some sites collection");
siteCollection.RootWeb.Update();