FileIOPermissionAccess.AllAccess : FileIOPermissionAccess : Security C# Source Code


Custom Search

C# Source Code » Security » FileIOPermissionAccess »

 

FileIOPermissionAccess.AllAccess








    
 
using System;
using System.Collections.Generic;
using System.Text;
using System.Security;
using System.Security.Permissions;

class Program {
    static void Main(string[] args) {
        CodeAccessPermission permissionA = new FileIOPermission(FileIOPermissionAccess.AllAccess, @"C:\");
        CodeAccessPermission permissionB = new FileIOPermission(FileIOPermissionAccess.Read, @"C:\temp");
        if (permissionB.IsSubsetOf(permissionA)) {
            Console.WriteLine("PermissionB is a subset of PermissionA");
        } else {
            Console.WriteLine("PermissionB is NOT a subset of PermissionA");
        }
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Security
» FileIOPermissionAccess