自动填充集成Windows身份验证

时间:2014-12-29 12:14:31

标签: c# sharepoint windows-integrated-auth

我正在使用C#创建应用程序,此应用程序将自动导航到Sharepoint站点并收集一些信息。我拥有网站的基本用户权限(意味着我不在网站管理员处),SP网站使用集成Windows身份验证,如下所示,enter image description here

我的问题是,当WebBrowser控件导航到网站时,如何让C#应用程序自动填充所需的凭据,我一直在阅读不同的路线,但没有清楚了解如何实现这一点。

这是一个非常基本的细分, - 申请开始 - '导航'单击按钮 - WebBrowser1 Control导航到SP站点并自动填充提供的凭据(在代码中)。

enter image description here

如果需要,请随时提出更多信息,谢谢你提前。

1 个答案:

答案 0 :(得分:0)

这是我用来完成此操作的代码,

WebClient client = new WebClient();
        CredentialCache cc = new CredentialCache();
        cc.Add(new Uri("http://spSite"), "NTLM", new NetworkCredential(username, password, domain));
        client.Credentials = cc;
相关问题