Writing CAS-Aware Code

At this point, you should have a pretty good idea of what CAS is, how it works behind the scenes of all managed code, and what options you have for administering security policy. This next section will show you some of the various coding techniques that you can employ to not only make your applications aware of security, but to better interact with security policy and CAS.

There are two different ways in which your application can specify which permissions it needs or the permissions that are required of the caller in order to invoke it. You can use an imperative security syntax, which uses specific methods from the security namespace to interact with CAS. The other method you can employ is to use declarative security, ...

Get Microsoft® Visual C#® .NET 2003 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.