TrustLevel Class
.NET Framework 2.0
Defines the mapping of specific security levels to named policy files. This class cannot be inherited.
Namespace: System.Web.Configuration
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
The following code example demonstrates how to use the TrustLevel type.
#region Using directives using System; using System.Collections.Generic; using System.Text; using System.Configuration; using System.Web; using System.Web.Configuration; #endregion namespace Samples.Aspnet.SystemWebConfiguration { class UsingTrustLevel { static void Main(string[] args) { try { // Display title. Console.WriteLine("ASP.NET TrustLevel Info"); Console.WriteLine(); // Instantiate a new TrustLevel object. TrustLevel TrustLevel1 = new TrustLevel("myLevel1", "myLevel1.config"); // Get the Name of the TrustLevel object. Console.WriteLine("Name: {0}", TrustLevel1.Name); // Instantiate a new TrustLevel object. TrustLevel TrustLevel2 = new TrustLevel("myLevel2", "myLevel2.config"); // Get the PolicyFile of the TrustLevel object. Console.WriteLine("PolicyFile: {0}", TrustLevel2.PolicyFile); } catch (Exception e) { // Unknown error. Console.WriteLine(e.ToString()); } // Display and wait. Console.ReadLine(); } } }
Community Additions
ADD
Show: