skamale
skamale

Reputation: 673

how to set the folder permission programatically in c#

I need to set the folder permission programatically. My requirement is when i set the parent folder, all its subfolders must inherit the parent permissions.

Upvotes: 0

Views: 2971

Answers (1)

Evan Mulawski
Evan Mulawski

Reputation: 55334

You would need to use the System.Management and System.Security frameworks:

http://www.redmondpie.com/applying-permissions-on-any-windows-folder-using-c/

To apply the same permissions in all subdirectories, you would need to use a foreach loop to iterate over all subdirectories of the directory you wish to modify.

Upvotes: 2

Related Questions