다음을 통해 공유


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 된 개체를 사용하여 특성 값을 수정할 수 있습니다.

적용 대상