【发布时间】:2021-10-13 14:17:30
【问题描述】:
目前,我可以使用下面给出的用户 ID 和密码访问共享点列表。但想了解如何使用客户端 ID 和客户端密码访问列表?
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();
【问题讨论】:
标签: c# asp.net sharepoint