1) In Visual Studio,Create the Console app as follows
using (var context = new ClientContext("https://<Your Office 365 site>.sharepoint.com"))
{
var password = new SecureString();
foreach (var c in "<ur Office 365 Pwd")
{
secureString.AppendChar(c);
}
context.Credentials = new SharePointOnlineCredentials("login@sp.onmicrosoft.com", password);
var web = clientContext.Web;
clientContext.Load(web);
clientContext.ExecuteQuery();
}
2)Make sure that you are referring correct SharePoint Client SDK dlls with respect to SharePoint Online.
No comments:
Post a Comment