编程语言
首页 > 编程语言> > c# sharepoint client object model 创建文档库

c# sharepoint client object model 创建文档库

作者:互联网

ClientTools tools = new ClientTools();
ClientContext clientContext= tools.GetContext(OnlineSiteUrl, User, Pass, true); //false 本地 true ONline

Web web = clientContext.Site.OpenWeb("WebUrl");
clientContext.Load(web);
clientContext.ExecuteQuery();
clientContext.Dispose();

// Create the library
ListCreationInformation creationInfo = new ListCreationInformation();
creationInfo.Title = "LibraryName";
creationInfo.Description = "LibraryDescription";
creationInfo.TemplateType = 101;
//creationInfo.TemplateType = (Int32)ListTemplateType.DocumentLibrary;
web.Lists.Add(creationInfo);
clientContext.ExecuteQuery();

标签:web,sharepoint,ExecuteQuery,creationInfo,c#,object,new,tools,clientContext
来源: https://www.cnblogs.com/selenazhou/p/12964592.html