7 Nisan 2013 Pazar

C# 32 ile 255 arası ASCII tablosu listeleme

C# 32 ile 255 arası ASCII tablosu listeleme

namespace ascii_kod_tablosu
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            listBox1.Font = new Font("Times New Roman", 12, FontStyle.Bold);
            listBox1.MultiColumn = true; //Sütünların çoklu olması sağlanır.

            int i;
            for (i = 32;i<=255; i++) //Döngüden sonra noktalı virgül konulmaz!
         listBox1.Items.Add(Convert.ToString(i)+" = "+(char)i);
            //Convert.ToString(i) yerine i.ToString kullanılabilir.
        }

    }

Hiç yorum yok:

Yorum Gönder