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
- 상속
- 특성
예제
다음 코드 예제에서는 기존 웹 애플리케이션의 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 액세스할 수 있습니다.
생성자
| Name | Description |
|---|---|
| AuthorizationRuleCollection() |
AuthorizationRuleCollection 클래스의 새 인스턴스를 초기화합니다. |
속성
메서드
명시적 인터페이스 구현
| Name | Description |
|---|---|
| ICollection.CopyTo(Array, Int32) |
배열에 ConfigurationElementCollection 복사합니다. (다음에서 상속됨 ConfigurationElementCollection) |
확장명 메서드
| Name | Description |
|---|---|
| AsParallel(IEnumerable) |
쿼리의 병렬 처리를 사용하도록 설정합니다. |
| AsQueryable(IEnumerable) |
IEnumerable IQueryable변환합니다. |
| Cast<TResult>(IEnumerable) |
IEnumerable 요소를 지정된 형식으로 캐스팅합니다. |
| OfType<TResult>(IEnumerable) |
지정된 형식에 따라 IEnumerable 요소를 필터링합니다. |