欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

c# sharepoint client object model 客户端如何创建中英文站点

程序员文章站 2022-06-20 18:25:45
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();

 

效果图如下:

c# sharepoint client object model 客户端如何创建中英文站点c# sharepoint client object model 客户端如何创建中英文站点