次の方法で共有


ConfigurationAttribute.Name プロパティ

定義

構成属性の名前を取得します。

public:
 property System::String ^ Name { System::String ^ get(); };
public string Name { get; }
member this.Name : string
Public ReadOnly Property Name As String

プロパティ値

構成属性の名前。

次の例では、各構成属性の Name プロパティの値を取得します。 このコード例は、ConfigurationAttribute クラスのために提供されている大規模な例の一部です。

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

注釈

属性名は、構成要素内で一意である必要があります。

適用対象