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 使用哪些加密與雜湊演算法來解密與驗證傳入資料,請參見 機器鍵元素(ASP.NET 設定結構)

適用於