Csharp/C Sharp by API/System.Security.Permissions/UIPermission — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 15:31, 26 мая 2010
new UIPermission
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");
}
}