I want to make a windows form application and want to use windows authentication to log in the user, it has to be used in intranet. the applcation should accept the user name an
You can achieve this using Interop Services. Use the below Code.
[System.Runtime.InteropServices.DllImport("advapi32.dll")]
public static extern bool LogonUser(string userName, string domainName, string password, int LogonType, int LogonProvider, ref IntPtr phToken);
public bool IsValidateCredentials(string userName, string password, string domain)
{
IntPtr tokenHandler = IntPtr.Zero;
bool isValid = LogonUser(userName, domain, password, 3, 0, ref tokenHandler);
return isValid;
}