Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

C#: Convertir un tableau d’octet en String


{filelink=19655}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
 
namespace Mesexemples
{
    class Program
    {
        static void Main(string[] args)
        {
            byte[] bytes = new Byte[args[0].Length];
            Console.WriteLine("Octet en String: "+ ByteArrayToString(bytes));
            Console.ReadLine();
        }
        public static string ByteArrayToString(byte[] characters)
        {
            ASCIIEncoding encoding = new ASCIIEncoding();
            string resultString = encoding.GetString(characters);
 
            return (resultString);
        }
    }
 
}

No comments yet.

Leave a Comment