Click here to Skip to main content
15,889,931 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I'm trying to write a Vc++ program in where I want to check whether a given username and password exists in the network. If the user exists in the Windows and the password is correct then I have to return a positive value, if the user exists but the password is not correct then I have to return a negative value. I know that I can use LogonUser to check this, but until now I haven't succeeded to do this correctly.
please give the sample code .
Posted
Comments
Richard MacCutchan 24-Sep-11 10:06am    
Stating that you haven't succeeded does not help anyone to guess what may be wrong. Get some details and diagnostic information and show some code and the results you get.

1 solution

If you read the LogonUser[^] documentation you will see that it is recommended to use the SSPI API to validate credentials (what you are trying to do I assume), LogonUser[^] should be used for impersonation.
The LogonUser[^] documentation refers to How to validate user credentials on Microsoft operating systems[^] on how to do this, this article contains a sample.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900