| | |
C# code to deny access to local hard disk drives
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
You can't. Whatever you are trying to do you are going about it the wrong way. This is more to do with security policies than programming.
•
•
Join Date: Jun 2008
Posts: 10
Reputation:
Solved Threads: 0
hi sknake....
dnt knw y u said a big NO.... sorry, we can do with the System.Management namespace... i did dat bt still some prblm is der.. i mean i can deny access to read,write,delete etc but i cannot change it back to the allowed state... Classes are there like
myDirectorySecurity.AddAccessRule(new FileSystemAccessRule(User, FileSystemRights.FullControl, AccessControlType.Allow)); but it is nt wrkng unfortunately.. dats y....
Its possible with System.Management namespace ... ok???
Thankzzzzzzz
dnt knw y u said a big NO.... sorry, we can do with the System.Management namespace... i did dat bt still some prblm is der.. i mean i can deny access to read,write,delete etc but i cannot change it back to the allowed state... Classes are there like
myDirectorySecurity.AddAccessRule(new FileSystemAccessRule(User, FileSystemRights.FullControl, AccessControlType.Allow)); but it is nt wrkng unfortunately.. dats y....
Its possible with System.Management namespace ... ok???
Thankzzzzzzz
file systems manage drives access, not programs or operating systems. you can modify the filing system's access rights to users by using applications to modify the security permissions in the filing system, but It wasn't designed to be modified frequently like that. you could end up with a completely inaccessible drive.
There are much better ways to go about it. I agree with Scott and Dan. not only can you not. If you do find a way, you most certainly shouldn't.
There are much better ways to go about it. I agree with Scott and Dan. not only can you not. If you do find a way, you most certainly shouldn't.
![]() |
Similar Threads
- Computer Cannot Detect Hard Disk Drives (Storage)
- Windows installaton message "Setup didn't find any hard disk drives installed..." (Storage)
- For PCPro12: Computer Cannot Detect Hard Disk Drives (Storage)
Other Threads in the C# Forum
- Previous Thread: Getting started with C#
- Next Thread: Update website control from usercontrol?
| Thread Tools | Search this Thread |
.net access algorithm array barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom cyclethruopenforms data database datagrid datagridview dataset date/time datetime degrees development dll draganddrop drawing encryption enum event excel file finalyearproject form format forms function gdi+ getoutlookcontactusinfcsvfile globalization httpwebrequest image index input install installer java label list listbox mandelbrot math mono mouseclick mysql operator panel path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox save server silverlight sleep socket sql sql-server statistics stream string table text textbox thread time timer timespan update usercontrol users validate validation visualstudio webbrowser wia windows winforms wpf xml






