Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ClientContext clientContext = new ClientContext("https://innergen.sharepoint.com/sites/mydevsite");
- Web web = clientContext.Web;
- clientContext.Load(web);
- clientContext.ExecuteQuery();
- Console.WriteLine("Web Site Name : " + web.Title);
- Console.ReadLine();
- NetworkCredential credentials =
- new NetworkCredential("username", "pwd", "domain");
- clientContext .Credentials = credentials;
- clientContext.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
- using (ClientContext clientContext = new ClientContext("HTTPS://YOURSHAREPOINTONLINESITE"))
- {
- string userName = "xyz";
- string password = "abc";
- SecureString secpassword = new SecureString();
- foreach (char c in password.ToCharArray()) secpassword.AppendChar(c);
- // SharePoint Online Credentials
- clientContext.ExecutingWebRequest += clientContext_ExecutingWebRequest;
- clientContext.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
- // Get the SharePoint web
- Web web = clientContext.Web;
- // Load the Web properties
- clientContext.Load(web);
- // Execute the query to the server.
- clientContext.ExecuteQuery();
- // Web properties - Display the Title and URL for the web
- Console.WriteLine("Title: " + web.Title + "; URL: " + web.Url);
- Console.ReadLine();
- Console.ReadKey();
- }
Add Comment
Please, Sign In to add comment