次の方法で共有


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

適用対象

こちらもご覧ください