AuthorizationRuleCollection クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
AuthorizationRule オブジェクトのコレクションを表します。 このクラスは継承できません。
public ref class AuthorizationRuleCollection sealed : System::Configuration::ConfigurationElementCollection
[System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.AuthorizationRule), AddItemName="allow,deny", CollectionType=System.Configuration.ConfigurationElementCollectionType.BasicMapAlternate)]
public sealed class AuthorizationRuleCollection : System.Configuration.ConfigurationElementCollection
[<System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.AuthorizationRule), AddItemName="allow,deny", CollectionType=System.Configuration.ConfigurationElementCollectionType.BasicMapAlternate)>]
type AuthorizationRuleCollection = class
inherit ConfigurationElementCollection
Public NotInheritable Class AuthorizationRuleCollection
Inherits ConfigurationElementCollection
- 継承
- 属性
例
次のコード例は、既存の Web アプリケーションの構成ファイルから AuthorizationRuleCollection オブジェクトを取得する方法を示しています。 次のトピックに示すように、このオブジェクトを使用してメンバーにアクセスします。 構成ファイルには、次のようなセットアップが含まれます。
<authorization>
<allow users="userName" roles="admin" verbs="post" />
<deny users="*" verbs="post"/>
</authorization>
// Get the Web application configuration.
System.Configuration.Configuration configuration =
WebConfigurationManager.OpenWebConfiguration(
"/aspnetTest");
' Get the Web application configuration.
Dim configuration As System.Configuration.Configuration = _
WebConfigurationManager.OpenWebConfiguration( _
"/aspnetTest")
// Get the section.
AuthorizationSection authorizationSection =
(AuthorizationSection)configuration.GetSection(
"system.web/authorization");
' Get the section.
Dim authorizationSection _
As AuthorizationSection = _
CType(configuration.GetSection( _
"system.web/authorization"), AuthorizationSection)
// Get the authorization rule collection.
AuthorizationRuleCollection authorizationRuleCollection =
authorizationSection.Rules;
' Get the authorization rule collection.
Dim authorizationRuleCollection _
As AuthorizationRuleCollection = _
authorizationSection.Rules
注釈
AuthorizationRuleCollection型を使用すると、authorization セクション コレクションの要素にアクセスできます。
コンストラクター
| 名前 | 説明 |
|---|---|
| AuthorizationRuleCollection() |
AuthorizationRuleCollection クラスの新しいインスタンスを初期化します。 |
プロパティ
メソッド
明示的なインターフェイスの実装
| 名前 | 説明 |
|---|---|
| ICollection.CopyTo(Array, Int32) |
ConfigurationElementCollection を配列にコピーします。 (継承元 ConfigurationElementCollection) |
拡張メソッド
| 名前 | 説明 |
|---|---|
| AsParallel(IEnumerable) |
クエリの並列化を有効にします。 |
| AsQueryable(IEnumerable) |
IEnumerable を IQueryableに変換します。 |
| Cast<TResult>(IEnumerable) |
IEnumerable の要素を指定した型にキャストします。 |
| OfType<TResult>(IEnumerable) |
指定した型に基づいて、IEnumerable の要素をフィルター処理します。 |