MachineKey.Encode(Byte[], MachineKeyProtection) Yöntem

Tanım

Dikkat

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.

Verileri şifreler ve/veya karma tabanlı bir ileti kimlik doğrulama kodu (HMAC) ekler.

public:
 static System::String ^ Encode(cli::array <System::Byte> ^ data, System::Web::Security::MachineKeyProtection protectionOption);
public static string Encode (byte[] data, 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 string Encode (byte[] data, System.Web.Security.MachineKeyProtection protectionOption);
static member Encode : byte[] * System.Web.Security.MachineKeyProtection -> string
[<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 Encode : byte[] * System.Web.Security.MachineKeyProtection -> string
Public Shared Function Encode (data As Byte(), protectionOption As MachineKeyProtection) As String

Parametreler

data
Byte[]

Şifrelenmesi gereken veriler.

protectionOption
MachineKeyProtection

Parametrenin data şifrelenip şifrelenmeyeceğini ve/veya karma oluşturulup oluşturulmayacağını gösterir.

Döndürülenler

String

Şifrelenmiş değer, bir HMAC eklenmiş giriş değeri veya eklenen HMAC ile giriş değerini şifrelemenin sonucu.

Öznitelikler

Örnekler

Kod örneği için bkz. sınıfa MachineKey genel bakış.

Açıklamalar

ASP.NET geçirilen verilerin şifresini çözmek ve doğrulamak için hangi şifreleme ve karma algoritmalarını kullandığı hakkında bilgi için bkz. machineKey Öğesi (ASP.NET Ayarlar Şeması).

Şunlara uygulanır