string siteUserName="nam",_siteurl="http://sharepoint.com",_sitepassword ="pass@word1";
ClientContext clientContext = new ClientContext(_siteurl);
clientContext.AuthenticationMode =ClientAuthenticationMode.Default;
clientContext.Credentials = new System.Net.NetworkCredential(_siteUserName, _sitepassword, _domainName);
Web oweb = clientContext.Web;
ListCreationInformation lci = ListCreationInformation();
lci.Description = "Test";
lci.Title = "TestName";
lci.TemplateType = 101;
SharePointclientObj.List newLib = clientContext.Web.Lists.Add(lci);
clientContext.Load(newLib);
clientContext.ExecuteQuery();
ClientContext clientContext = new ClientContext(_siteurl);
clientContext.AuthenticationMode =ClientAuthenticationMode.Default;
clientContext.Credentials = new System.Net.NetworkCredential(_siteUserName, _sitepassword, _domainName);
Web oweb = clientContext.Web;
ListCreationInformation lci = ListCreationInformation();
lci.Description = "Test";
lci.Title = "TestName";
lci.TemplateType = 101;
SharePointclientObj.List newLib = clientContext.Web.Lists.Add(lci);
clientContext.Load(newLib);
clientContext.ExecuteQuery();
No comments:
Post a Comment