Kracken
Kracken

Reputation: 664

Protect directory from modify C#

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

Thanks!

Upvotes: 1

Views: 253

Answers (2)

Michael Goldshteyn
Michael Goldshteyn

Reputation: 74360

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.

Upvotes: 0

dasheddot
dasheddot

Reputation: 2966

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

Upvotes: 1

Related Questions