1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
byte[] bytearray = new byte[3] { 0x10, 0x50, 0xFF };
this.textBox1.Text = BitConverter.ToString(bytearray);
char[] chars= new char [bytearray.Length ];
Decoder d = Encoding.UTF8.GetDecoder();
int charLen = d.GetChars(bytearray, 0, bytearray.Length, chars, 0);
foreach (char c in chars)
textBox2.Text+=(ushort)c + " ; " ;
}
} |
Partager