次の方法で共有


ConfigurationElement.Attributes プロパティ

定義

この要素の属性の一覧を含む構成属性コレクションを取得します。

public:
 property Microsoft::Web::Administration::ConfigurationAttributeCollection ^ Attributes { Microsoft::Web::Administration::ConfigurationAttributeCollection ^ get(); };
public Microsoft.Web.Administration.ConfigurationAttributeCollection Attributes { get; }
member this.Attributes : Microsoft.Web.Administration.ConfigurationAttributeCollection
Public ReadOnly Property Attributes As ConfigurationAttributeCollection

プロパティ値

ConfigurationAttributeCollectionこの要素の属性の一覧を格納している オブジェクト。

次の例では、構成要素属性の Attributes コレクションである プロパティ値を取得します。 属性の name 値が "TestDemo" の場合、要素は要素コレクションから削除されます。 このコード例は、ConfigurationElement クラスのために提供されている大規模な例の一部です。

ConfigurationElementCollection elementCollection = 
    moduleProvidersSection.GetCollection();
// If there is a configuration element with the name of TestDemo(Modified), delete it.
ConfigurationElement elementtoremove = null;
foreach (ConfigurationElement moduleproviderelement in elementCollection)
{
    if(moduleproviderelement.Attributes["name"].Value.ToString() == "TestDemo(Modified)")
    {
        elementtoremove = moduleproviderelement;
    }
}
if (elementtoremove != null)
{
    elementCollection.Remove(elementtoremove);
}

注釈

返された ConfigurationAttributeCollection オブジェクトを使用して属性値を変更できます。

適用対象