MachineKey.Encode(Byte[], MachineKeyProtection) Methode
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Let op
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.
Hiermee versleutelt u gegevens en/of voegt u een HMAC (Hash-based Message Authentication Code) toe.
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
Parameters
- data
- Byte[]
De gegevens die moeten worden versleuteld.
- protectionOption
- MachineKeyProtection
Geeft aan of de data parameter moet worden versleuteld en/of gehasht.
Retouren
De versleutelde waarde, de invoerwaarde waaraan een HMAC is toegevoegd of het resultaat van het versleutelen van de invoerwaarde waaraan een HMAC is toegevoegd.
- Kenmerken
Voorbeelden
Zie het MachineKey klassenoverzicht voor een codevoorbeeld.
Opmerkingen
Zie machineKey-element (ASP.NET Settings Schema) voor informatie over welke versleutelings- en hash-algoritmen ASP.NET gebruikt voor het ontsleutelen en valideren van de gegevens die worden doorgegeven.