다음을 통해 공유


ConfigurationAttribute.GetMetadata(String) 메서드

정의

IIS 7 구성 시스템에서 특성 메타데이터를 가져옵니다.

public:
 System::Object ^ GetMetadata(System::String ^ metadataType);
public object GetMetadata (string metadataType);
member this.GetMetadata : string -> obj
Public Function GetMetadata (metadataType As String) As Object

매개 변수

metadataType
String

반환할 메타데이터의 이름입니다.

반환

IIS 7 구성 시스템에서 요청한 metadataType 것과 일치하는 특성 메타데이터입니다.

예제

다음 예제에서는 각 구성 특성에 대한 메타데이터를 가져옵니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 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"));
}

적용 대상

추가 정보