April 2002
Intermediate to advanced
816 pages
20h 56m
English
The most straightforward way to protect a resource is by explicitly using permissions. Permissions explicitly protecting resources in the secure class library code will look something like the following if used imperatively:
new FileIOPermission(FileIOPermissionAccess.AllAccess, @"C:\ mydir\ myapp.xml").Demand();
or something like the following if used declaratively:
[FileIOPermission(SecurityAction.Demand, All=@"C:\ mydir\ myapp.xml")]
In all cases of explicit protection, there will be some kind of Demand, LinkDemand, or InheritanceDemand in the code. Demands may occur either imperatively or declaratively. LinkDemands and InheritanceDemands will only be found in declarative form.
In my experience, ...
Read now
Unlock full access