c# sharepoint client object model 客户端如何创建中英文站点
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();
效果图如下: