简体   繁体   中英

Autofill an Integrated Windows Authentication

I'm making an application with C#, this application will automatically navigate to a SharePoint site and gather some information. I have basic User Rights to the site (Meaning I'm not at a Site Admin), the SP site uses Integrated Windows Authentication which looks like this, 在此处输入图片说明

How can I get the C# application to autofill the needed credentials when the WebBrowser control navigates to the site?

This is a very basic break-down, - Application Opens - 'Navigate' Button is clicked - WebBrowser1 Control Navigates to the SP Site and autofills the supplied credentials (Within the code).

在此处输入图片说明

This is the code I'm using to complete this operation,

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM