Using this function we can verify user credentials.
[DllImport("ADVAPI32.DLL")] public static extern bool LogonUser(String lpszUsername, String lpszDomain, String lpszPassword, int dwLogonType, int dwLogonProvider, out int phToken); const int LOGON32_LOGON_INTERACTIVE = 2; const int LOGON32_LOGON_NETWORK = 3; const int LOGON32_PROVIDER_DEFAULT = 0; const int LOGON32_PROVIDER_WINNT50 = 3; const int LOGON32_PROVIDER_WINNT40 = 2; const int LOGON32_PROVIDER_WINNT35 = 1;
private bool isValidUser(string userName, string domainName, string passsWord) { bool Validateuser; int token1; Validateuser = LogonUser(userName, domainName, passsWord, LOGON32_LOGON_NETWORK, 0, out token1);
if (Validateuser) { return true; } else { return false; } }
|
No responses found. Be the first to respond and make money from revenue sharing program.
|