Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
Can we access windows password from our C# ?I tried write the programm and searched on net .I found that we cant access uer password.Could any one answer correctly to my question?
Posted
Updated 27-Aug-12 1:30am
v2
Comments
Sandeep Mewara 27-Aug-12 7:02am    
?If yes please write the code snippet
It does not work like this here.

Here is what is expected of enquirers:
1. TRY first what you want to do! You may find that it's not that hard.
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.
Members will be more than happy to help like this.

Windows Password is a One way Hash password. With lot of effort you can retrieve the hash value of your password. But you cannot get the actual password itself.
Retrieve the Windows 7 Password Hash on the Fly[^]
 
Share this answer
 
You can get the current identity of the user under which the current thread is running (not necessarily the logged in user) using WindowsIdentity.GetCurrent(). Alternatively you can get the logged in user name via the Environment.UserName property. It is not guaranteed to be the user running the current process however.

There is no Windows API to get a user's password as passwords aren't stored in Windows.

Have a look on Reset Windows Administrator Account Password in C#[^]
 
Share this answer
 
v2
Comments
Member 14372118 18-Jun-19 11:15am    
What reference?

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