using System;
using System.Windows.Forms;

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

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                int[] a = { 4, 5, 6 };
                a[4] = 9;
            }
            catch (IndexOutOfRangeException)
            {
                MessageBox.Show("دسترسی غیر مجاز");
            }
        }
    }
}