Share via


ConfigurationAttribute.Value Eigenschaft

Definition

Ruft den Wert des Konfigurationsattributes ab.

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

Eigenschaftswert

Der Wert des Konfigurationsattributes.

Beispiele

Im folgenden Beispiel wird der Wert der Value -Eigenschaft für jedes der Konfigurationsattribute abgerufen. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die ConfigurationAttribute-Klasse bereitgestellt wird.

// 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"));
}

Hinweise

Konfigurationsattributewerte sind nicht stark typisiert. Der Wert dieser Eigenschaft muss explizit in den richtigen Typ umgewandelt werden.

Gilt für: