Remarque
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de vous connecter ou de modifier des répertoires.
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de modifier des répertoires.
Cet exemple de code montre comment copier vers et à partir de tableaux d’octets dans une application WinUI.
public void ByteArrayCopy()
{
// Initialize a byte array.
byte[] bytes = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
// Create a buffer from the byte array.
IBuffer buffer = CryptographicBuffer.CreateFromByteArray(bytes);
// Encode the buffer into a hexadecimal string (for display);
string hex = CryptographicBuffer.EncodeToHexString(buffer);
// Copy the buffer back into a new byte array.
byte[] newByteArray;
CryptographicBuffer.CopyToByteArray(buffer, out newByteArray);
}
Collaborer avec nous sur GitHub
La source de ce contenu se trouve sur GitHub, où vous pouvez également créer et examiner les problèmes et les demandes de tirage. Pour plus d’informations, consultez notre guide du contributeur.
Windows developer