Use SecurityManager to check the FileIOPermissionAccess.Write : File Security Permission « Windows « C# / C Sharp






Use SecurityManager to check the FileIOPermissionAccess.Write

 

using System;
using System.Security;
using System.Security.Permissions;

class MainClass {
    public static void Main() {
        FileIOPermission fileIOPerm = new FileIOPermission(FileIOPermissionAccess.Write, @"C:\Data");
        Console.WriteLine(SecurityManager.IsGranted(fileIOPerm));
    }
}
           
         
  








Related examples in the same category

1.Demand FileIOPermissionAccess.AllAccess
2.FileSecurity
3.FileSystemRights.Read
4.Open File In Explorer