Click to See Complete Forum and Search --> : How to get current username and password


Clara
May 20th, 1999, 09:52 PM
Hi, everyone:
Who can tell me how to get current logon user name and passwor programmablly under Windows NT or Windows 95?
Please tell me as soon as possible!
Thank you!
clara

May 21st, 1999, 04:14 AM
You can get the name of the logged in user via the NetUserGetInfo() API call, but there is no way to get the user's password programmatically. This is by design, and is a fundamental security restriction of almost every OS known to man. You can, however, test a potential password to see if it is the "real" one, so you could conceivably ask the user for their password, then check it to make sure they didn't lie to you...

Cheers!
Humble Programmer
,,,^..^,,,

May 21st, 1999, 05:34 AM
Hello


How can you test if the user specified correct password.
Can you actually login programmaticly ?

May 21st, 1999, 06:49 AM
Read Micro$oft Knowlege Base article Q180548 "HOWTO: Validate User Credentials on Microsoft WinNT and Win95". It even has a snippet of sample code to point you in the right direction.

Cheers!
Humble Programmer
,,,^..^,,,