MachineKey.Decode(String, MachineKeyProtection) 方法

定义

注意

This method is obsolete and is only provided for compatibility with existing code. It is recommended that new code use the Protect and Unprotect methods instead.

已加密或提供基于哈希消息的验证代码 (HMAC) 的解码和/或验证数据。

public:
 static cli::array <System::Byte> ^ Decode(System::String ^ encodedData, System::Web::Security::MachineKeyProtection protectionOption);
public static byte[] Decode (string encodedData, System.Web.Security.MachineKeyProtection protectionOption);
[System.Obsolete("This method is obsolete and is only provided for compatibility with existing code. It is recommended that new code use the Protect and Unprotect methods instead.")]
public static byte[] Decode (string encodedData, System.Web.Security.MachineKeyProtection protectionOption);
static member Decode : string * System.Web.Security.MachineKeyProtection -> byte[]
[<System.Obsolete("This method is obsolete and is only provided for compatibility with existing code. It is recommended that new code use the Protect and Unprotect methods instead.")>]
static member Decode : string * System.Web.Security.MachineKeyProtection -> byte[]
Public Shared Function Decode (encodedData As String, protectionOption As MachineKeyProtection) As Byte()

参数

encodedData
String

要解密和/或验证的加密数据。

protectionOption
MachineKeyProtection

指示 encodedData 参数是否应该加密和/或进行哈希运算。

返回

Byte[]

Byte 数组,它表示已解密的数据。

属性

示例

有关代码示例,请参阅 MachineKey 类概述。

注解

有关 ASP.NET 使用哪些加密和哈希算法来解密和验证传入的数据的信息,请参阅 machineKey Element (ASP.NET Settings Schema)

适用于