1

How to change directory permissions so that user cant rename it and create/delete/modify files in it while programm working?

Thanks!

Kracken
  • 622
  • 1
  • 8
  • 26

2 Answers2

1

Maybe you are looking for something like this: MSDN

Additionally there is already a question on StackOverflow with an simple answer: How to lock files

Community
  • 1
  • 1
dasheddot
  • 2,846
  • 4
  • 23
  • 33
  • i dont watching how to lock files i seek for locking directories – Kracken Oct 31 '11 at 21:07
  • Oh, seems that i misread your question. I was never needed to lock entire directories, but accordingly to what you are doing maybe this helps: http://stackoverflow.com/questions/1433964/can-we-lock-a-directory – dasheddot Nov 06 '11 at 20:29
0

To do this, you would have to change permissions on the directory. You can do this using the FileIOPermission class in the System.Security.Permissions namespace.

Michael Goldshteyn
  • 68,941
  • 23
  • 129
  • 179