Click here to Skip to main content
15,906,574 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to protect to access or Lock the C drive using C# windows form?
Posted
Comments
Sandeep Mewara 26-May-11 1:31am    
An executable application locking a full drive... can you elaborate on what and why please?
Sergey Alexandrovich Kryukov 26-May-11 1:43am    
How about D drive? Seriously, do you thing C can be hard-coded, or this is just for an example? On one of my systems Windows drive is E...
Why, why all that?
--SA

hi ,
I dont't know this is right or not.. any way read this answer :~
http://www.codeproject.com/Messages/2872030/How-i-Lock-my-Harddisk-drive-in-csharp-net.aspx[^]
 
Share this answer
 
v2
Simple, lock the desktop.

C#
[DllImport("user32")]
public static extern void LockWorkStation();


In Button.Click event call LockWorkStation()
 
Share this answer
 
v2
It's called "user privileges", and you set it in the OS. You can't change those from an application unless the application in question is "run as administrator". You should tread carefully here because the use is well within his rights to write to his own user-specific folders.

What are you trying to accomplish that Windows bult-in functionality can't do for you?
 
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