Partager via


Conversion de données (HTML)

[ Cet article est destiné aux développeurs de Windows 8.x et Windows Phone 8.x qui créent des applications Windows Runtime. Si vous développez une application pour Windows 10, voir la Documentation ]

L’exemple suivant montre comment utiliser la méthode convertStringToBinary pour convertir une chaîne de texte en une chaîne binaire.


function ConvertData( password )
{

    try {

        // Convert the password to a binary string.
        var secret = Windows.Security.Cryptography.CryptographicBuffer.convertStringToBinary(password, Windows.Security.Cryptography.BinaryStringEncoding.utf8);

    }
    catch ( ) {

        // Handle the error.
    }
}