Refuse request for ReflectionPermission : Permissions « Security « C# / CSharp Tutorial

Home
C# / CSharp Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statement
5.String
6.struct
7.Class
8.Operator Overload
9.delegate
10.Attribute
11.Data Structure
12.Assembly
13.Date Time
14.Development
15.File Directory Stream
16.Preprocessing Directives
17.Regular Expression
18.Generic
19.Reflection
20.Thread
21.I18N Internationalization
22.LINQ
23.GUI Windows Forms
24.Windows Presentation Foundation
25.Windows Communication Foundation
26.Workflow
27.2D
28.Design Patterns
29.Windows
30.XML
31.XML LINQ
32.ADO.Net
33.Network
34.Directory Services
35.Security
36.unsafe
C# / C Sharp
C# / C Sharp by API
C# / CSharp Open Source
C# / CSharp Tutorial » Security » Permissions 
35.4.5.Refuse request for ReflectionPermission
using System;
using System.Net;
using System.Security.Permissions;


[assembly: ReflectionPermission(SecurityAction.RequestRefuse, Unrestricted = true)]
class MainClass
{
    public static void Main()
    {
        FileIOPermission fileIOPerm = new FileIOPermission(FileIOPermissionAccess.Write, @"C:\Data");

        fileIOPerm.Demand();

    }
}
35.4.Permissions
35.4.1.UnmanagedCode element of SecurityPermission( controls the code’s ability to execute unmanaged code)
35.4.2.File IO Permission: SecurityAction.RequestRefuse, Write
35.4.3.Internet SecurityAction
35.4.4.Optional permission request for IsolatedStorageFilePermission
35.4.5.Refuse request for ReflectionPermission
35.4.6.Test if the current assembly has the specified permission
35.4.7.Specify the certification file
35.4.8.A declarative role-based security demand for the current principal
35.4.9.A declarative role-based security demand for the current principal to be a member of the roles Managers OR Developers
35.4.10.An imperative role-based security demand for the current principal to represent an identity with the name Anya AND be a member of the Managers role
35.4.11.An imperative role-based security demand for the current principal to represent an identity with the name Anya, the roles of the principal are irrelevant
35.4.12.PrincipalPolicy.Intersect/Union
35.4.13.Create PrincipalPermission for Administrators
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.