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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.