This documentation is archived and is not being maintained.
TrustLevel Class
Visual Studio 2008
Defines the mapping of specific security levels to named policy files. This class cannot be inherited.
Assembly: System.Web (in System.Web.dll)
The following code example demonstrates how to use the TrustLevel type.
Imports System Imports System.Collections.Generic Imports System.Text Imports System.Configuration Imports System.Web Imports System.Web.Configuration Namespace Samples.Aspnet.SystemWebConfiguration Class UsingTrustLevel Public Shared Sub Main() Try ' Display title. Console.WriteLine("ASP.NET TrustLevel Info") Console.WriteLine() ' Instantiate a new TrustLevel object. Dim TrustLevel1 As TrustLevel = _ New TrustLevel("myLevel1", "myLevel1.config") ' Get the Name of the TrustLevel object. Console.WriteLine("Name: {0}", TrustLevel1.Name) ' Instantiate a new TrustLevel object. Dim TrustLevel2 As TrustLevel = _ New TrustLevel("myLevel2", "myLevel2.config") ' Get the PolicyFile of the TrustLevel object. Console.WriteLine("PolicyFile: {0}", TrustLevel2.PolicyFile) Catch e As Exception ' Unknown error. Console.WriteLine(e.ToString()) End Try ' Display and wait. Console.ReadLine() End Sub End Class End Namespace
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: