如何从ActiveDocument获取凭据?

时间:2017-04-20 20:10:25

标签: c# sharepoint vsto sharepoint-2013

我正在编写VSTO Word Addin。此插件从sharepoint在线读取信息(列表)。

如何从ActiveDocument类获取凭据以创建ContextClient ?

我尝试使用System.Net.CredentialCache.DefaultCredentials

ClientContext context = new ClientContext(url);
context.AuthenticationMode = ClientAuthenticationMode.Default;
context.Credentials = System.Net.CredentialCache.DefaultCredentials;

Web web = context.Web;
context.Load(web);
context.Load(web.CurrentUser);
context.ExecuteQuery();

Web rootWeb = context.Site.RootWeb;
context.Load(rootWeb, rw => rw.Url);
context.ExecuteQuery();
rootContextUrl = context.Site.RootWeb.Url;

如何让它在线运行Sharepoint。它在Sharepoint on premise中工作。

由于

0 个答案:

没有答案