简体   繁体   中英

retrieve and set NTFS permissions using c#

I m confused how can I retrieve and set the NTFS permission for a directory using c#

such as Save file Stream and save file security

I'm looking for how can I save those properties for an executable so that it's stream cannot be modified.

System.Security.AccessControl.FileSecurity would be the place to start.

See the example on that page using File.GetAccessControl method to get an instance.

NB.

it's stream cannot be modified .

ACLs can always be overridden (not least my anyone with the Take Ownership privilege: as all local administrators have). If you want to ensure an exe is not modified you would be better looking at code signing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM