コード例 #1
0
ファイル: Form1.cs プロジェクト: lsjtop10/Hidato-Solver
        private void button1_Click(object sender, EventArgs e)
        {
            int nRows, nCols;

            try
            {
                nRows = int.Parse(textBox1.Text);
                nCols = int.Parse(textBox2.Text);
            }
            catch (FormatException)
            {
                MessageBox.Show("Invlaid number of rows or columns specified.");
                return;
            }
            catch (OverflowException)
            {
                MessageBox.Show("Invlaid number of rows or columns specified.");
                return;
            }

            Hidato_Board board = new Hidato_Board(nCols, nRows);

            board.Show();
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: lsjtop10/Hidato-Solver
        private void buttonLoad_Click(object sender, EventArgs e)
        {
            Stream stream;

            try
            {
                stream = File.OpenRead(textBox3.Text);
            }
            catch (System.Exception)
            {
                textBox3.Text = "";
                return;
            }


            StreamReader sr = new StreamReader(stream);

            Hidato_Board board = new Hidato_Board(sr);

            sr.Close();
            stream.Close();

            board.Show();
        }