TrustLevelCollection.Get(Int32) 方法

定义

获取位于指定索引位置的 TrustLevel 对象。

public:
 System::Web::Configuration::TrustLevel ^ Get(int index);
public System.Web.Configuration.TrustLevel Get (int index);
member this.Get : int -> System.Web.Configuration.TrustLevel
Public Function Get (index As Integer) As TrustLevel

参数

index
Int32

TrustLevelCollection 的索引。

返回

TrustLevel

指定索引处的 TrustLevel

示例

下面的代码示例演示如何使用 Get 方法。 此代码示例是为类提供的大型示例的 TrustLevelCollection 一部分。

// Display item details of the collection.
for (int i = 0; i < TrustLevelCollection1.Count; i++)
{
  Console.WriteLine("Collection item {0}", i);
  Console.WriteLine("Name: {0}", 
    TrustLevelCollection1.Get(i).Name);
  Console.WriteLine("PolicyFile: {0}", 
    TrustLevelCollection1.Get(i).PolicyFile);
  Console.WriteLine();
}
' Display item details of the collection.
For i As Integer = 0 To (TrustLevelCollection1.Count - 1)
  Console.WriteLine("Collection item {0}", i)
  Console.WriteLine("Name: {0}", _
   TrustLevelCollection1.Get(i).Name)
  Console.WriteLine("PolicyFile: {0}", _
   TrustLevelCollection1.Get(i).PolicyFile)
  Console.WriteLine()
Next i

适用于