RoleProviderCollection 클래스

정의

RoleProvider 추상 클래스를 상속하는 개체의 컬렉션입니다.

public ref class RoleProviderCollection sealed : System::Configuration::Provider::ProviderCollection
public sealed class RoleProviderCollection : System.Configuration.Provider.ProviderCollection
type RoleProviderCollection = class
    inherit ProviderCollection
Public NotInheritable Class RoleProviderCollection
Inherits ProviderCollection
상속
RoleProviderCollection

예제

다음 코드 예제에서는 애플리케이션 및 해당 유형이 사용 되는 공급자를 나열 합니다.

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web.Security" %>
<%@ Import Namespace="System.Configuration.Provider" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>List Enabled Providers</title>
</head>
<body>

<%
foreach (RoleProvider p in Roles.Providers)
  Response.Write(p.Name + ", " + p.GetType() + "<br />");
%>

</body>
</html>
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Web.Security" %>
<%@ Import Namespace="System.Configuration.Provider" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>List Enabled Providers</title>
</head>
<body>

<%
For Each p As RoleProvider In Roles.Providers
  Response.Write(p.Name & ", " & p.GetType().ToString() & "<br />")
Next
%>

</body>
</html>

설명

애플리케이션에 대 한 역할 공급자는 읽기 전용으로 표시 됩니다 RoleProviderCollection 여는 Providers 의 속성을 Roles 클래스. 컬렉션의 특정 역할 공급자를 이름으로 액세스할 수 있으며와 같은 특정 공급자 유형으로 캐스팅할 SqlRoleProvider합니다. 이렇게 하면 단일 애플리케이션에서 여러 데이터 저장소에서 역할 정보를 관리할 수 있을 뿐만 아니라 없는 역할 공급자의 사용자 지정 멤버에 액세스할 수 있습니다의 일부는 RoleProvider 추상 클래스입니다.

생성자

RoleProviderCollection()

비어 있는 새 역할 공급자 컬렉션을 만듭니다.

속성

Count

컬렉션의 공급자 수를 가져옵니다.

(다음에서 상속됨 ProviderCollection)
IsSynchronized

해당 컬렉션에 대한 액세스가 동기화되어 스레드로부터 안전하게 보호되는지를 나타내는 값을 가져옵니다.

(다음에서 상속됨 ProviderCollection)
Item[String]

지정된 공급자 이름으로 참조되는 역할 공급자를 컬렉션에서 가져옵니다.

SyncRoot

현재 개체를 가져옵니다.

(다음에서 상속됨 ProviderCollection)

메서드

Add(ProviderBase)

역할 공급자를 컬렉션에 추가합니다.

Clear()

컬렉션에서 모든 항목을 제거합니다.

(다음에서 상속됨 ProviderCollection)
CopyTo(ProviderBase[], Int32)

지정된 인덱스에서 시작하여 지정된 배열에 컬렉션의 내용을 복사합니다.

(다음에서 상속됨 ProviderCollection)
CopyTo(RoleProvider[], Int32)

역할 공급자 컬렉션을 1차원 배열에 복사합니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetEnumerator()

컬렉션을 반복할 IEnumerator 인터페이스를 구현하는 개체를 반환합니다.

(다음에서 상속됨 ProviderCollection)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
Remove(String)

컬렉션에서 공급자를 제거합니다.

(다음에서 상속됨 ProviderCollection)
SetReadOnly()

컬렉션을 읽기 전용으로 설정합니다.

(다음에서 상속됨 ProviderCollection)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

ICollection.CopyTo(Array, Int32)

ProviderCollection의 요소를 특정 배열 인덱스에서 시작하여 배열에 복사합니다.

(다음에서 상속됨 ProviderCollection)

확장 메서드

Cast<TResult>(IEnumerable)

IEnumerable의 요소를 지정된 형식으로 캐스팅합니다.

OfType<TResult>(IEnumerable)

지정된 형식에 따라 IEnumerable의 요소를 필터링합니다.

AsParallel(IEnumerable)

쿼리를 병렬화할 수 있도록 합니다.

AsQueryable(IEnumerable)

IEnumerableIQueryable로 변환합니다.

적용 대상

추가 정보