|
Listing 6-19 extracted from chapter
Security
Listing 6-18< > Listing 6-20
This listing can be compiled with the command line: csc.exe /target:exe Example_6_19.cs Errors: 0 Warnings: 0
Example_6_19.cs
using System.Security.Permissions;
class Program {
[PrincipalPermission( SecurityAction.Demand,
Role= @"BUILTIN\Administrators")]
static void Main() {
// Here, the principal is an administrator.
}
}
Copyright Patrick Smacchia 2006 2007
|