🙂 İNSANLARIN EN HAYIRLISI INSANLARA FAYDALI OLANDIR 🙂

Burak HABER / C# / 129. Exception ve Mesajlar

1-) C# - 129. Exception ve Mesajlar

using System;

using System.Windows.Forms;

 

namespace _129ExceptionveMesajlar

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

 

        private void button1_Click(object sender, EventArgs e)

        {

            try

            {

                int s1, s2, sonuc;

                s1 = Convert.ToInt32(textBox1.Text);

                s2 = Convert.ToInt32(textBox2.Text);

                sonuc = s1 * s2;

                label1.Text = sonuc.ToString();

            }

            catch (Exception hata)

            {

                MessageBox.Show(hata.ToString());

            }

 

        }

    }

}

 2021 Mart 11 Perşembe
 473