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();