ConfigurationAttribute.GetMetadata(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets attribute metadata from the IIS 7 configuration system.
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
Parameters
- metadataType
- String
The name of the metadata to return.
Returns
The attribute metadata that matches the requested metadataType
from the IIS 7 configuration system.
Examples
The following example gets the metadata for each of the configuration attributes. This code example is part of a larger example provided for the ConfigurationAttribute class.
// 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"));
}
Applies to
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for