Share via


MachineKeySection.DataProtectorType 屬性

定義

取得或設定資料保護裝置類型的名稱。 預設為 Empty

public:
 property System::String ^ DataProtectorType { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.TypeConverter(typeof(System.Configuration.WhiteSpaceTrimStringConverter))]
[System.Configuration.ConfigurationProperty("dataProtectorType", DefaultValue="")]
public string DataProtectorType { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Configuration.WhiteSpaceTrimStringConverter))>]
[<System.Configuration.ConfigurationProperty("dataProtectorType", DefaultValue="")>]
member this.DataProtectorType : string with get, set
Public Property DataProtectorType As String

屬性值

資料保護裝置類型的名稱。

屬性

備註

若要指定 ASP.NET 的自訂資料保護演算法,請將 MachineKeySection.CompatibilityMode 屬性設定為 Framework45 ,並將此屬性設定為代表衍生自 類別之類別的 DataProtector 字串。 此字串會對應至 providerClass 傳遞至靜態 DataProtector.Create Factory 方法的參數。 即使您未指定 Framework45 選項,您指定的 類別也會由 MachineKey.ProtectMachineKey.Unprotect 方法使用。

如果您設定此屬性,您也必須設定 ApplicationName 屬性。

適用於