Compartilhar via


CryptographicBuffer.EncodeToHexString(IBuffer) Método

Definição

Codifica um buffer em uma cadeia de caracteres hexadecimal.

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

Parâmetros

buffer
IBuffer

Buffer de entrada.

Retornos

String

Platform::String

winrt::hstring

Cadeia de caracteres de saída codificada em hexadecimal.

Exemplos

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);
}

Aplica-se a