Convertir un tableau d’octets en une chaîne de caractère

Author:

énumérer,toutes,les,cultures,disponibles
{filelink=19571}

using System;
using System.Text;

class OctetsEnString
{
    public static void Main()
	{
        Byte[] octets= new Byte[]
		{
        69,120,101,109,112,108,101,32,69,110,99,111,100,97,103,101,32,
        115,117,114,32,109,101,115,101,120,101,109,112,108,101,115,46,99
        ,111,109
        };

        ASCIIEncoding ascii = new ASCIIEncoding();
        // Décoder le tableau d'octets en String
        String stringDecodé = ascii.GetString(octets);
        Console.WriteLine(stringDecodé);
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *