Export (0) Print
Expand All

Security Sample

This sample shows how to modify security permissions through permission classes and permission attributes.

This sample contains the source code for the Security Tutorial.

Building and Running the Sample Within Visual Studio

To build and run the Security samples

  1. Open the solution (Security.sln).
  2. In Solution Explorer, right-click the Security1 project and click Set as StartUp Project.
  3. From the Debug menu, click Start Without Debugging.
  4. Repeat the preceding steps for Security2 and Security3.

Building and Running the Sample from the Command Line

To build and run the Security samples

  1. Use the Change Directory command to change to the Security1 directory.
  2. Type the following:
    csc ImperativeSecurity.cs
    ImperativeSecurity
    
  3. Use the Change Directory command to change to the Security2 directory.
  4. Type the following:
    csc DeclarativeSecurity.cs
    DeclarativeSecurity
    
  5. Use the Change Directory command to change to the Security3 directory.
  6. Type the following:
    csc SuppressSecurity.cs
    SuppressSecurity
    

See Also

Security Tutorial | Tutorial Samples

Show:
© 2014 Microsoft