ConfigurationAttribute.SetMetadata(String, Object) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
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();