c# sharepoint client object model 客戶端如何創建中英文站點 ClientContext ClientValidate = tools.GetContext(OnlineSiteUrl, User, Pass, true); Web oWebSite = Client ...
c# sharepoint client object model 客戶端如何創建中英文站點
ClientContext ClientValidate = tools.GetContext(OnlineSiteUrl, User, Pass, true);
Web oWebSite = ClientValidate.Web;
ClientValidate.Load(oWebSite);
ClientValidate.Load(oWebSite.Webs);
ClientValidate.ExecuteQuery();
//創建一個siteweb的站點
WebCreationInformation creation = new WebCreationInformation();
creation.Url = "siteweb";
creation.Title = "siteweb";
creation.Description = "siteweb";
creation.Language = 1033; // 選擇英語作為預設語言
//creation.Language = 2052; // 選擇中文作為預設語言
Web newWeb = oWebSite.Webs.Add(creation);
newWeb.IsMultilingual = false; //不勾選備用語言
//newWeb.AddSupportedUILanguage(1033); // English
//newWeb.AddSupportedUILanguage(1031); // German
//newWeb.AddSupportedUILanguage(1036); // French
//newWeb.AddSupportedUILanguage(1046); // Portugese (Brazil)
//newWeb.AddSupportedUILanguage(1049); // Russian
////newWeb.AddSupportedUILanguage(2052); // Chinese (Simplified)
//newWeb.AddSupportedUILanguage(3082); // Spanish
newWeb.Update();
ClientValidate.Load(newWeb);
ClientValidate.ExecuteQuery();
效果圖如下: