Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to unlock user PC using C# [duplicate]

Possible Duplicate:
Unlock Windows programmatically

I am writing an app that will lock and than unlock user PC. Locking a machine is relativeley simple. However unlocking is just plain black magic for me...

Lets assume, that after some event (ex. timer reaches 30 min mark) my app forces my PC to unlock.

I want to unlock latest user (the one that locked the machine) with provided password. I know, that you shouldn't give anyone your passwords, but after all - I am writing that program :)

Sssso... Any hints where to start?

like image 636
a_dzik Avatar asked Dec 12 '12 07:12

a_dzik


People also ask

How do I unlock a user account on my computer?

Press CTRL+ALT+DELETE to unlock the computer. Type the logon information for the last logged on user, and then click OK. When the Unlock Computer dialog box disappears, press CTRL+ALT+DELETE and log on normally.

How do I unlock a user account using command prompt?

Tap control + alt + delete twice at the login screen for the option to type in a username and enter Administrator which should provide access to a command prompt where you can view Windows accounts by typing net user and apply a new password via net user USERNAME PASSWORD (example: net user Bill bestpassw0rd)

How do you unlock a locked Windows account?

To unlock your account, sign in to get a security code. Tips: You can use any phone number to request the security code. The phone number doesn't need to be associated with your account.


2 Answers

You cannot unlock a machine automatically to my knowledge. What you can do though is to do a fake lock on the machine. Maximize the form, disable all special key combinations, remove explorer, etc. When time is up, do the opposite.

like image 194
RAS Avatar answered Sep 28 '22 02:09

RAS


You cannot unlock/log in to windows using c#

You can do it with C++ though, you need to write your own implementation of GINA(Graphical Identification and Authentication)

http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/c87b5f27-fdeb-4b41-88f0-72e140a11358/

However, this is way beyond the borders of BAD security practice, i cannot stress this enough.

like image 38
Lars Nielsen Avatar answered Sep 28 '22 03:09

Lars Nielsen