Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
Hello Sir

In my project i need to lock and unlock the drive of hard disc .

Example:
consider in a company there will be 2 shifts so for a one system is applicable to both so for one user i will reserve a drive to him and another drive i need to lock it which is reverser to another employe . viceversa for the another user.
So can anybody suggest me how to lock and unlock a drive in C# .net 2008
It will be better if u suggest with an example
Thanks in Advance.Arun
Posted
Comments
Sergey Alexandrovich Kryukov 3-Aug-11 3:34am    
I would not call it "lock". Normally it is done using file system permission. Do you need to modify volume permissions programmatically?
--SA
arunrv 3-Aug-11 4:56am    
k then what shall i do to lock a file . i know to lock a folder and how to hide a file but i need to lock file .

1 solution

I don't see any practical sense in doing so. It could be done statically by setting different volume permissions for different volumes. In this case, the required operation would be log out and log in as a different user. If the permissions for a volume should be done for more then one user, you could create groups and assign permissions for groups. Any system administrator can do it.

Would you also consider the hardware solution? These days, it is not very expensive to have a desktop, server or industrial-grade computer with hot-swappable hard drives. (Even my own notebook PC has this feature which I consider very important to me.) Each shift could use its own separate hard drive and swap it when a shift is changed. I personally would highly prefer such hardware solution to anything else.

—SA
 
Share this answer
 
v3

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