다음을 통해 공유


ConfigurationAttribute.SetMetadata(String, Object) 메서드

정의

IIS 7 구성 시스템에서 특성 메타데이터를 설정합니다.

public:
 void SetMetadata(System::String ^ metadataType, System::Object ^ value);
public void SetMetadata (string metadataType, object value);
member this.SetMetadata : string * obj -> unit
Public Sub SetMetadata (metadataType As String, value As Object)

매개 변수

metadataType
String

설정할 메타데이터의 이름입니다.

value
Object

메타데이터에 할당할 값입니다.

예제

다음 예제에서는 각 구성 특성에 대한 메타데이터를 가져옵니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 ConfigurationAttribute 클래스입니다.

ServerManager manager = new ServerManager();
Configuration config = manager.GetApplicationHostConfiguration();
ConfigurationSection configSection =
    config.GetSection("system.web/anonymousIdentification");

ConfigurationAttributeCollection configAttributeCollection =
    configSection.Attributes;

ConfigurationAttribute attribute = configAttributeCollection[1];
// Use any of the following encryption providers.
// attribute.SetMetadata("encryptionProvider", "IISWASOnlyRsaProvider");
// attribute.SetMetadata("encryptionProvider", "AesProvider");
attribute.SetMetadata("encryptionProvider", "IISWASOnlyAesProvider");

// Commit the changes to applicationHost.config
manager.CommitChanges();

적용 대상

추가 정보