Partager via


CryptographicBuffer.EncodeToHexString(IBuffer) Méthode

Définition

Encode une mémoire tampon en chaîne hexadécimale.

public:
 static Platform::String ^ EncodeToHexString(IBuffer ^ buffer);
 static winrt::hstring EncodeToHexString(IBuffer const& buffer);
public static string EncodeToHexString(IBuffer buffer);
function encodeToHexString(buffer)
Public Shared Function EncodeToHexString (buffer As IBuffer) As String

Paramètres

buffer
IBuffer

Mémoire tampon d’entrée.

Retours

String

Platform::String

winrt::hstring

Chaîne de sortie encodée hexadécimale.

Exemples

public void EncodeDecodeHex()
{
    // Define a hexadecimal string.
    String strHex = "30310AFF";

    // Decode a hexadecimal string to binary.
    IBuffer buffer = CryptographicBuffer.DecodeFromHexString(strHex);

    // Encode the buffer back into a hexadecimal string.
    String strHexNew = CryptographicBuffer.EncodeToHexString(buffer);
}

S’applique à