ConfigurationAttribute.Value Propriété

Définition

Obtient la valeur de l’attribut de configuration.

public:
 property System::Object ^ Value { System::Object ^ get(); void set(System::Object ^ value); };
public object Value { get; set; }
member this.Value : obj with get, set
Public Property Value As Object

Valeur de propriété

Valeur de l’attribut de configuration.

Exemples

L’exemple suivant obtient la valeur de la Value propriété pour chacun des attributs de configuration. Cet exemple de code fait partie d’un exemple plus grand fourni pour la ConfigurationAttribute classe .

// Get the attributes again, after the commit changes.
Configuration config2 = manager.GetApplicationHostConfiguration();
configSection = config2.GetSection("system.web/anonymousIdentification");
configAttributeCollection = configSection.Attributes;
Console.WriteLine("There are " +
    configAttributeCollection.Count.ToString() +
    " Configuration attributes.");
attribute = configAttributeCollection[1];
Console.WriteLine("metadata: " +
    attribute.GetMetadata("encryptionProvider"));
// Display each configuration attribute with properties and metadata.
foreach (ConfigurationAttribute configAttribute in configAttributeCollection)
{
    Console.WriteLine("\t{0}\t{1}\t{2}\t{3}",
         configAttribute.Name,
         configAttribute.Value,
         configAttribute.IsProtected,
         configAttribute.GetMetadata("encryptionProvider"));
}

Remarques

Les valeurs d’attribut de configuration ne sont pas fortement typées. La valeur de cette propriété doit être explicitement convertie en type correct.

S’applique à