FormsAuthenticationUserCollection Classe

Definição

Representa uma coleção de objetos FormsAuthenticationUser .Represents a collection of FormsAuthenticationUser objects. Essa classe não pode ser herdada.This class cannot be inherited.

public ref class FormsAuthenticationUserCollection sealed : System::Configuration::ConfigurationElementCollection
[System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.FormsAuthenticationUser), AddItemName="user", CollectionType=System.Configuration.ConfigurationElementCollectionType.BasicMap)]
public sealed class FormsAuthenticationUserCollection : System.Configuration.ConfigurationElementCollection
[<System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.FormsAuthenticationUser), AddItemName="user", CollectionType=System.Configuration.ConfigurationElementCollectionType.BasicMap)>]
type FormsAuthenticationUserCollection = class
    inherit ConfigurationElementCollection
Public NotInheritable Class FormsAuthenticationUserCollection
Inherits ConfigurationElementCollection
Herança
FormsAuthenticationUserCollection
Atributos

Exemplos

O exemplo de código a seguir mostra como obter o FormsAuthenticationUserCollection objeto do arquivo de configuração de um aplicativo Web existente.The following code example shows how to obtain the FormsAuthenticationUserCollection object from the configuration file of an existing Web application.

Observação

Se você usar o elemento, certifique-se de credentials seguir as diretrizes explicadas em autenticação ASP.net.If you use the credentials element be sure to follow the guidelines explained at ASP.NET Authentication. Para obter escalabilidade e mais segurança, é recomendável usar um banco de dados externo para armazenar as credenciais dos usuários.For scalability and better security, it is recommended you use an external database to store the users' credentials. Para obter mais informações sobre como criar aplicativos ASP.NET seguros, consulte protegendo seu aplicativo ASP.net e criando aplicativos ASP.NET seguros: autenticação, autorização e comunicação segura.For more information about building secure ASP.NET applications, see Securing Your ASP.NET Application and Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication.


// Get the Web application configuration.
System.Configuration.Configuration configuration = 
    WebConfigurationManager.OpenWebConfiguration("/aspnetTest");

// Get the authentication section.
AuthenticationSection authenticationSection = 
    (AuthenticationSection)configuration.GetSection(
    "system.web/authentication");

// Get the forms credentials collection .
FormsAuthenticationCredentials formsAuthenticationCredentials =
    authenticationSection.Forms.Credentials;

' Get the Web application configuration.
  Dim configuration As System.Configuration.Configuration = _
  WebConfigurationManager.OpenWebConfiguration( _
  "/aspnetTest")

' Get the authentication section.
  Dim authenticationSection _
  As AuthenticationSection = _
  CType(configuration.GetSection( _
  "system.web/authentication"), AuthenticationSection)

' Get the forms credentials collection .
  Dim formsAuthenticationCredentials _
  As FormsAuthenticationCredentials = _
  authenticationSection.Forms.Credentials

Comentários

O FormsAuthenticationCredentials usa o FormsAuthenticationUserCollection para acessar e modificar programaticamente o users elemento da credentials seção na forms seção da authorization seção de configuração.The FormsAuthenticationCredentials uses the FormsAuthenticationUserCollection to programmatically access and modify the users element of the credentials section in the forms section of the authorization configuration section.

Esse tipo é parte de um grupo que inclui os FormsAuthenticationConfiguration tipos, FormsAuthenticationCredentials e FormsAuthenticationUser .This type is part of a group that includes the FormsAuthenticationConfiguration, the FormsAuthenticationCredentials, and the FormsAuthenticationUser types.

Construtores

FormsAuthenticationUserCollection()

Inicializa uma nova instância da classe FormsAuthenticationUserCollection.Initializes a new instance of the FormsAuthenticationUserCollection class.

Propriedades

AddElementName

Obtém ou define o nome do ConfigurationElement a ser associado à operação de adição no ConfigurationElementCollection quando substituído em uma classe derivada.Gets or sets the name of the ConfigurationElement to associate with the add operation in the ConfigurationElementCollection when overridden in a derived class.

(Herdado de ConfigurationElementCollection)
AllKeys

Obtém todas as chaves da coleção.Gets all the collection's keys.

ClearElementName

Obtém ou define o nome do ConfigurationElement a ser associado à operação de limpeza no ConfigurationElementCollection quando substituído em uma classe derivada.Gets or sets the name for the ConfigurationElement to associate with the clear operation in the ConfigurationElementCollection when overridden in a derived class.

(Herdado de ConfigurationElementCollection)
CollectionType

Obtém o tipo do FormsAuthenticationUserCollection.Gets the type of the FormsAuthenticationUserCollection.

Count

Obtém o número de elementos na coleção.Gets the number of elements in the collection.

(Herdado de ConfigurationElementCollection)
CurrentConfiguration

Obtém uma referência para a instância Configuration de nível superior que representa a hierarquia de configuração à qual a instância atual ConfigurationElement pertence.Gets a reference to the top-level Configuration instance that represents the configuration hierarchy that the current ConfigurationElement instance belongs to.

(Herdado de ConfigurationElement)
ElementInformation

Obtém um objeto ElementInformation que contém as informações não personalizáveis e a funcionalidade do objeto ConfigurationElement.Gets an ElementInformation object that contains the non-customizable information and functionality of the ConfigurationElement object.

(Herdado de ConfigurationElement)
ElementName

Obtém o nome usado para identificar esta coleção de elementos no arquivo de configuração quando substituído em uma classe derivada.Gets the name used to identify this collection of elements in the configuration file when overridden in a derived class.

(Herdado de ConfigurationElementCollection)
ElementProperty

Obtém o objeto ConfigurationElementProperty que representa o próprio objeto ConfigurationElement.Gets the ConfigurationElementProperty object that represents the ConfigurationElement object itself.

(Herdado de ConfigurationElement)
EmitClear

Obtém ou define um valor que especifica se a coleção foi limpa.Gets or sets a value that specifies whether the collection has been cleared.

(Herdado de ConfigurationElementCollection)
EvaluationContext

Obtém o objeto ContextInformation para o objeto ConfigurationElement.Gets the ContextInformation object for the ConfigurationElement object.

(Herdado de ConfigurationElement)
HasContext

Obtém um valor que indica se a propriedade CurrentConfiguration é null.Gets a value that indicates whether the CurrentConfiguration property is null.

(Herdado de ConfigurationElement)
IsSynchronized

Obtém um valor que indica se o acesso à coleção é sincronizado.Gets a value indicating whether access to the collection is synchronized.

(Herdado de ConfigurationElementCollection)
Item[ConfigurationProperty]

Obtém ou define uma propriedade ou um atributo desse elemento de configuração.Gets or sets a property or attribute of this configuration element.

(Herdado de ConfigurationElement)
Item[Int32]

Obtém o FormsAuthenticationUser no índice especificado.Gets the FormsAuthenticationUser at the specified index.

Item[String]

Obtém o FormsAuthenticationUser com o nome especificado.Gets the FormsAuthenticationUser with the specified name.

LockAllAttributesExcept

Obtém a coleção de atributos bloqueados.Gets the collection of locked attributes.

(Herdado de ConfigurationElement)
LockAllElementsExcept

Obtém a coleção de elementos bloqueados.Gets the collection of locked elements.

(Herdado de ConfigurationElement)
LockAttributes

Obtém a coleção de atributos bloqueados.Gets the collection of locked attributes.

(Herdado de ConfigurationElement)
LockElements

Obtém a coleção de elementos bloqueados.Gets the collection of locked elements.

(Herdado de ConfigurationElement)
LockItem

Obtém ou define um valor que indica se o elemento está bloqueado.Gets or sets a value indicating whether the element is locked.

(Herdado de ConfigurationElement)
Properties

Obtém a coleção de propriedades.Gets the collection of properties.

(Herdado de ConfigurationElement)
RemoveElementName

Obtém ou define o nome do ConfigurationElement a ser associado à operação de remoção no ConfigurationElementCollection quando substituído em uma classe derivada.Gets or sets the name of the ConfigurationElement to associate with the remove operation in the ConfigurationElementCollection when overridden in a derived class.

(Herdado de ConfigurationElementCollection)
SyncRoot

Obtém um objeto usado para sincronizar o acesso ao ConfigurationElementCollection.Gets an object used to synchronize access to the ConfigurationElementCollection.

(Herdado de ConfigurationElementCollection)
ThrowOnDuplicate

Obtém um valor que indica se uma tentativa de adicionar uma duplicata ConfigurationElement ao ConfigurationElementCollection fará com que uma exceção seja lançada.Gets a value indicating whether an attempt to add a duplicate ConfigurationElement to the ConfigurationElementCollection will cause an exception to be thrown.

(Herdado de ConfigurationElementCollection)

Métodos

Add(FormsAuthenticationUser)

Adiciona um objeto de FormsAuthenticationUser à coleção.Adds a FormsAuthenticationUser object to the collection.

BaseAdd(ConfigurationElement)

Adiciona um elemento de configuração ao ConfigurationElementCollection.Adds a configuration element to the ConfigurationElementCollection.

(Herdado de ConfigurationElementCollection)
BaseAdd(ConfigurationElement, Boolean)

Adiciona um elemento de configuração à coleção de elementos de configuração.Adds a configuration element to the configuration element collection.

(Herdado de ConfigurationElementCollection)
BaseAdd(Int32, ConfigurationElement)

Adiciona um elemento de configuração à coleção de elementos de configuração.Adds a configuration element to the configuration element collection.

(Herdado de ConfigurationElementCollection)
BaseClear()

Remove todos os objetos de elemento de configuração da coleção.Removes all configuration element objects from the collection.

(Herdado de ConfigurationElementCollection)
BaseGet(Int32)

Obtém o elemento de configuração no local do índice especificado.Gets the configuration element at the specified index location.

(Herdado de ConfigurationElementCollection)
BaseGet(Object)

Retorna o elemento de configuração com a chave especificada.Returns the configuration element with the specified key.

(Herdado de ConfigurationElementCollection)
BaseGetAllKeys()

Retorna uma matriz das chaves para todos os elementos de configuração contidos no ConfigurationElementCollection.Returns an array of the keys for all of the configuration elements contained in the ConfigurationElementCollection.

(Herdado de ConfigurationElementCollection)
BaseGetKey(Int32)

Obtém a chave para o ConfigurationElement no local do índice especificado.Gets the key for the ConfigurationElement at the specified index location.

(Herdado de ConfigurationElementCollection)
BaseIndexOf(ConfigurationElement)

Indica o índice do ConfigurationElement especificado.Indicates the index of the specified ConfigurationElement.

(Herdado de ConfigurationElementCollection)
BaseIsRemoved(Object)

Indica se o ConfigurationElement com a chave especificada foi removido do ConfigurationElementCollection.Indicates whether the ConfigurationElement with the specified key has been removed from the ConfigurationElementCollection.

(Herdado de ConfigurationElementCollection)
BaseRemove(Object)

Remove um ConfigurationElement da coleção.Removes a ConfigurationElement from the collection.

(Herdado de ConfigurationElementCollection)
BaseRemoveAt(Int32)

Remove o ConfigurationElement no local de índice especificado.Removes the ConfigurationElement at the specified index location.

(Herdado de ConfigurationElementCollection)
Clear()

Remove todos os objetos FormsAuthenticationUser da coleção.Removes all FormsAuthenticationUser objects from the collection.

CopyTo(ConfigurationElement[], Int32)

Copia o conteúdo do ConfigurationElementCollection para uma matriz.Copies the contents of the ConfigurationElementCollection to an array.

(Herdado de ConfigurationElementCollection)
CreateNewElement()

Quando substituído em uma classe derivada, cria um novo ConfigurationElement.When overridden in a derived class, creates a new ConfigurationElement.

(Herdado de ConfigurationElementCollection)
CreateNewElement(String)

Cria um novo ConfigurationElement quando substituído em uma classe derivada.Creates a new ConfigurationElement when overridden in a derived class.

(Herdado de ConfigurationElementCollection)
DeserializeElement(XmlReader, Boolean)

Lê o XML do arquivo de configuração.Reads XML from the configuration file.

(Herdado de ConfigurationElement)
Equals(Object)

Compara o ConfigurationElementCollection ao objeto especificado.Compares the ConfigurationElementCollection to the specified object.

(Herdado de ConfigurationElementCollection)
Get(Int32)

Obtém o elemento da coleção FormsAuthenticationUser no índice especificado.Gets the FormsAuthenticationUser collection element at the specified index.

Get(String)

Obtém o elemento da coleção FormsAuthenticationUser com o nome especificado.Gets the FormsAuthenticationUser collection element with the specified name.

GetElementKey(ConfigurationElement)

Obtém a chave de elemento para um elemento de configuração especificado quando substituído em uma classe derivada.Gets the element key for a specified configuration element when overridden in a derived class.

(Herdado de ConfigurationElementCollection)
GetEnumerator()

Obtém um IEnumerator que é usado para iterar por meio de ConfigurationElementCollection.Gets an IEnumerator which is used to iterate through the ConfigurationElementCollection.

(Herdado de ConfigurationElementCollection)
GetHashCode()

Obtém um valor exclusivo que representa a instância ConfigurationElementCollection.Gets a unique value representing the ConfigurationElementCollection instance.

(Herdado de ConfigurationElementCollection)
GetKey(Int32)

Obtém a chave no índice da coleção FormsAuthenticationUserCollection especificado.Gets the key at the specified FormsAuthenticationUserCollection collection index.

GetTransformedAssemblyString(String)

Retorna a versão transformada do nome do assembly especificado.Returns the transformed version of the specified assembly name.

(Herdado de ConfigurationElement)
GetTransformedTypeString(String)

Retorna a versão transformada do nome do tipo especificado.Returns the transformed version of the specified type name.

(Herdado de ConfigurationElement)
GetType()

Obtém o Type da instância atual.Gets the Type of the current instance.

(Herdado de Object)
Init()

Define o objeto ConfigurationElement para seu estado inicial.Sets the ConfigurationElement object to its initial state.

(Herdado de ConfigurationElement)
InitializeDefault()

Usado para inicializar um conjunto padrão de valores para o objeto ConfigurationElement.Used to initialize a default set of values for the ConfigurationElement object.

(Herdado de ConfigurationElement)
IsElementName(String)

Indica se o ConfigurationElement especificado existe no ConfigurationElementCollection.Indicates whether the specified ConfigurationElement exists in the ConfigurationElementCollection.

(Herdado de ConfigurationElementCollection)
IsElementRemovable(ConfigurationElement)

Indica se o ConfigurationElement especificado pode ser removido de ConfigurationElementCollection.Indicates whether the specified ConfigurationElement can be removed from the ConfigurationElementCollection.

(Herdado de ConfigurationElementCollection)
IsModified()

Indica se este ConfigurationElementCollection foi modificado desde a última vez em que foi salvo ou carregado quando substituído em uma classe derivada.Indicates whether this ConfigurationElementCollection has been modified since it was last saved or loaded when overridden in a derived class.

(Herdado de ConfigurationElementCollection)
IsReadOnly()

Indica se o objeto ConfigurationElementCollection é somente leitura.Indicates whether the ConfigurationElementCollection object is read only.

(Herdado de ConfigurationElementCollection)
ListErrors(IList)

Adiciona os erros de propriedade inválida deste objeto ConfigurationElement e de todos os subelementos à lista passada.Adds the invalid-property errors in this ConfigurationElement object, and in all subelements, to the passed list.

(Herdado de ConfigurationElement)
MemberwiseClone()

Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object.

(Herdado de Object)
OnDeserializeUnrecognizedAttribute(String, String)

Obtém um valor que indica se um atributo desconhecido é encontrado durante a desserialização.Gets a value indicating whether an unknown attribute is encountered during deserialization.

(Herdado de ConfigurationElement)
OnDeserializeUnrecognizedElement(String, XmlReader)

Faz com que o sistema de configuração lance uma exceção.Causes the configuration system to throw an exception.

(Herdado de ConfigurationElementCollection)
OnRequiredPropertyNotFound(String)

Gera uma exceção quando uma propriedade necessária não é encontrada.Throws an exception when a required property is not found.

(Herdado de ConfigurationElement)
PostDeserialize()

Chamado depois da desserialização.Called after deserialization.

(Herdado de ConfigurationElement)
PreSerialize(XmlWriter)

Chamado antes da serialização.Called before serialization.

(Herdado de ConfigurationElement)
Remove(String)

Remove um objeto FormsAuthenticationUser da coleção.Removes a FormsAuthenticationUser object from the collection.

RemoveAt(Int32)

Remove da coleção um objeto FormsAuthenticationUser no índice especificado.Removes a FormsAuthenticationUser object at the specified index from the collection.

Reset(ConfigurationElement)

Redefine o ConfigurationElementCollection para seu estado inalterado quando substituído em uma classe derivada.Resets the ConfigurationElementCollection to its unmodified state when overridden in a derived class.

(Herdado de ConfigurationElementCollection)
ResetModified()

Redefine o valor da propriedade IsModified() para false quando substituído em uma classe derivada.Resets the value of the IsModified() property to false when overridden in a derived class.

(Herdado de ConfigurationElementCollection)
SerializeElement(XmlWriter, Boolean)

Grava os dados de configuração em um elemento XML no arquivo de configuração quando substituído em uma classe derivada.Writes the configuration data to an XML element in the configuration file when overridden in a derived class.

(Herdado de ConfigurationElementCollection)
SerializeToXmlElement(XmlWriter, String)

Grava as marcas externas desse elemento de configuração no arquivo de configuração quando implementado em uma classe derivada.Writes the outer tags of this configuration element to the configuration file when implemented in a derived class.

(Herdado de ConfigurationElement)
Set(FormsAuthenticationUser)

Modifica o objeto FormsAuthenticationUser especificado contido na coleção.Modifies the specified FormsAuthenticationUser object contained in the collection.

SetPropertyValue(ConfigurationProperty, Object, Boolean)

Define uma propriedade para o valor especificado.Sets a property to the specified value.

(Herdado de ConfigurationElement)
SetReadOnly()

Define a propriedade IsReadOnly() para o objeto ConfigurationElementCollection e para todos os subelementos.Sets the IsReadOnly() property for the ConfigurationElementCollection object and for all sub-elements.

(Herdado de ConfigurationElementCollection)
ToString()

Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object.

(Herdado de Object)
Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)

Inverte o efeito da mesclagem de informações de configuração de diferentes níveis da hierarquia de configuração.Reverses the effect of merging configuration information from different levels of the configuration hierarchy.

(Herdado de ConfigurationElementCollection)

Implantações explícitas de interface

ICollection.CopyTo(Array, Int32)

Copia o ConfigurationElementCollection para uma matriz.Copies the ConfigurationElementCollection to an array.

(Herdado de ConfigurationElementCollection)

Métodos de Extensão

Cast<TResult>(IEnumerable)

Converte os elementos de um IEnumerable para o tipo especificado.Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

Filtra os elementos de um IEnumerable com base em um tipo especificado.Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

Habilita a paralelização de uma consulta.Enables parallelization of a query.

AsQueryable(IEnumerable)

Converte um IEnumerable em um IQueryable.Converts an IEnumerable to an IQueryable.

Aplica-se a