Use UIPermission to Checking for security access : UIPermission : Development Class C# Source Code


Custom Search

C# Source Code » Development Class » UIPermission »

 

Use UIPermission to Checking for security access








    


using System;
using System.Security.Permissions;

class MainClass {
    public static void Main() {
        RegistryPermission f = new RegistryPermission(RegistryPermissionAccess.Read,"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");

        if (f.IsUnrestricted())
            Console.WriteLine("Unrestricted Access allowed");
        else
            Console.WriteLine("Unrestricted Access DENIED");

        FileIOPermission fileIO = new FileIOPermission(PermissionState.None);
        Console.WriteLine("All Local files read access: {0}",FileIOPermissionAccess.Read);
        Console.WriteLine("All Local files write access: {0}",FileIOPermissionAccess.Write);

        UIPermission ui = new UIPermission(UIPermissionWindow.AllWindows,UIPermissionClipboard.AllClipboard);
        if (ui.IsUnrestricted())
            Console.WriteLine("UI Unrestricted Access allowed");
        else
            Console.WriteLine("UI Unrestricted Access DENIED");

    }
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Development Class
» UIPermission