本文整理匯總了C#中System.Web.Configuration.TrustLevel類的典型用法代碼示例。如果您正苦於以下問題:C# TrustLevel類的具體用法?C# TrustLevel怎麽用?C# TrustLevel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TrustLevel類屬於System.Web.Configuration命名空間,在下文中一共展示了TrustLevel類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Main
#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();
}
}
}