'login automatically to NTLM Authentication site in Webbrowser WPF_C#
I try to open a site but first must fill username and password. I have username and password and I want to fill username and password in my code and users not see Authentication.
this is a sample, when click on button load page in WebBrowser tag:
my code:
string url = "http://sample.com";
private void Button_Click(object sender, RoutedEventArgs e)
{
string userName = "username";
string password = "pass";
byte[] authData = System.Text.UnicodeEncoding.UTF8.GetBytes(userName+":"+password);
string authHeader = "WWW-Authentication: NTLM " + Convert.ToBase64String(authData) + "\r\n";
myweb.Navigate(url,"", null, authHeader);
}
I read a lot solution but not work or I can't understand.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

