TrustLevelCollection クラスとは? わかりやすく解説

TrustLevelCollection クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

TrustLevel オブジェクトコレクション格納します。このクラス継承できません。

名前空間: System.Web.Configuration
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public NotInheritable Class
 TrustLevelCollection
    Inherits ConfigurationElementCollection
Dim instance As TrustLevelCollection
public sealed class TrustLevelCollection :
 ConfigurationElementCollection
public ref class TrustLevelCollection sealed
 : public ConfigurationElementCollection
public final class TrustLevelCollection extends
 ConfigurationElementCollection
public final class TrustLevelCollection extends
 ConfigurationElementCollection
解説解説
使用例使用例

TrustLevelCollection クラス使用する方法次のコード例示します

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Configuration
Imports System.Web
Imports System.Web.Configuration

Namespace Samples.Aspnet.SystemWebConfiguration
  Class UsingTrustLevelCollection
    Public Shared Sub Main()
      Try
        ' Display title.
        Console.WriteLine("ASP.NET TrustLevelCollection Info")
        Console.WriteLine()

        ' Instantiate a new TrustLevelCollection object.
        Dim TrustLevelCollection1 As TrustLevelCollection
 = _
          New TrustLevelCollection()

        ' Add a new TrustLevel to the collection.
        TrustLevelCollection1.Add(New TrustLevel("Level1",
 "Level1.config"))

        ' Create a new TrustLevel object.
        Dim TrustLevel2 As TrustLevel = _
          New TrustLevel("myLevel2",
 "myLevel2.config")

        ' Set the TrustLevel object within the collection.
        TrustLevelCollection1.Set(1, TrustLevel2)

        ' 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

      Catch e As Exception
        ' Unknown error.
        Console.WriteLine(e.ToString())
      End Try

      ' Display and wait.
      Console.ReadLine()
    End Sub
  End Class
End Namespace
#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 UsingTrustLevelCollection
  {
    static void Main(string[]
 args)
    {
      try
      {
        // Display title.
        Console.WriteLine("ASP.NET TrustLevelCollection Info");
        Console.WriteLine();
        
        // Instantiate a new TrustLevelCollection object.
        TrustLevelCollection TrustLevelCollection1 = 
          new TrustLevelCollection();

        // Add a new TrustLevel to the collection.
        TrustLevelCollection1.Add(new TrustLevel("Level1",
 "Level1.config"));

        // Create a new TrustLevel object.
        TrustLevel TrustLevel2 = 
          new TrustLevel("Level2", "Level2.config");

        // Set the TrustLevel object within the collection.
        TrustLevelCollection1.Set(1, TrustLevel2);

        // 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();
        }
      }

      catch (Exception e)
      {
        // Unknown error.
        Console.WriteLine(e.ToString());
      }

      // Display and wait.
      Console.ReadLine();
    }
  }
}
継承階層継承階層
System.Object
   System.Configuration.ConfigurationElement
     System.Configuration.ConfigurationElementCollection
      System.Web.Configuration.TrustLevelCollection
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TrustLevelCollection メンバ
System.Web.Configuration 名前空間
ConfigurationElementCollection



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「TrustLevelCollection クラス」の関連用語

TrustLevelCollection クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



TrustLevelCollection クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS