Test if the current assembly has the specified permission : Permissions : Security C# Examples


C# Examples » Security » Permissions »

 

Test if the current assembly has the specified permission









    
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));
        }
}
    
   
  
   



Output

True


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Security
» Permissions