magritton
2/25/2015 - 7:27 PM

This accesses the client object model of a SharePoint online instance

This accesses the client object model of a SharePoint online instance

ClientContext ci = new ClientContext("https://opwit.sharepoint.com/TestOCM");
            System.Security.SecureString passWord = new System.Security.SecureString();

            foreach (char c in "mypassword".ToCharArray()) passWord.AppendChar(c);
            ci.Credentials = new SharePointOnlineCredentials("mikegritton@opwit.onmicrosoft.com", passWord);
            ci.ExecuteQuery();