共用方式為


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

適用於