How c # sharepoint client object model to create a client site in English

 

How c # sharepoint client object model to create a client site in English

 

ClientContext ClientValidate = tools.GetContext(OnlineSiteUrl, User, Pass, true);

Web oWebSite = ClientValidate.Web;
ClientValidate.Load(oWebSite);
ClientValidate.Load(oWebSite.Webs);
ClientValidate.ExecuteQuery();

// Create a site siteweb

WebCreationInformation creation = new WebCreationInformation();

= creation.Url "SiteWeb";
creation.Title = "SiteWeb";
creation.Description = "SiteWeb";
creation.Language = 1033; // select English as the default language

//creation.Language = 2052; // choose Chinese as the default language
Web newWeb = oWebSite.Webs.Add (creation);

newWeb.IsMultilingual = false; // do not check the alternate language
//newWeb.AddSupportedUILanguage(1033); // Dictionary Dictionary 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();

 

The effect is as follows:

 

Guess you like

Origin www.cnblogs.com/selenazhou/p/11593629.html