Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string siteUrl = "https://xyz.sharepoint.com/sites/MyList/";
- ClientContext clientContext = new ClientContext(siteUrl);
- string username = ConfigurationManager.AppSettings["username"];
- string password = ConfigurationManager.AppSettings["password"];
- System.Security.SecureString passWord = new System.Security.SecureString();
- foreach (char c in password.ToCharArray())
- {
- passWord.AppendChar(c);
- }
- clientContext.Credentials = new SharePointOnlineCredentials(username, passWord);
- Web oWebsite = clientContext.Web;
- ListCollection collList = oWebsite.Lists;
- clientContext.Load(collList);
- clientContext.ExecuteQuery();
Add Comment
Please, Sign In to add comment