.NET Samples - How To: Security

This section includes the following samples:

CodeIdentityDemand Sample

RequestPermission Sample

WindowsIdentityCheck Sample

CodeIdentityDemand Sample

This sample describes how to control access to an assembly (or individual method within an assembly) using code access security.

Namespaces used in this sample:

(none)

Classes used in this sample:

(none)

RequestPermission Sample

This sample illustrates using permissions and policy to read Windows environment variables.

Namespaces used in this sample:

(none)

Classes used in this sample:

(none)

WindowsIdentityCheck Sample

This sample uses both WindowsPrincipal and PrincipalPermission to verify that a user is in a given Windows NT group.

Namespaces used in this sample:

(none)

Classes used in this sample:

(none)