string[] lines2 = { "1", "1"};

            string a = load_subwindow_number.ToString();

            MessageBox.Show(a);

            lines2[0] = a;

            try

            {

                FileStream fileStream = new FileStream("D:/winprogram repos/wpf/winproject_desktop_helper/winproject_desktop_helper/setting.txt", FileMode.Create, FileAccess.ReadWrite);

                MessageBox.Show("All is well");

                StreamWriter streamWriter = new StreamWriter(fileStream);

                streamWriter.WriteLine(lines2[0]);

                streamWriter.Close();

            }

            catch (FileNotFoundException)

            {

                MessageBox.Show("Not find file");

            }

            catch (DirectoryNotFoundException)

            {

                MessageBox.Show("Not find directory");

            }

            catch (Exception)

            {

                MessageBox.Show("Unknown error");

            }

            for (int i = 0; i < load_subwindow_number; i++)

            {

                (myList[i] as SubWindow).Close();

            }

            this.Close();


일케하고 load_subwindow_number 안바뀌면 그냥 멀쩡한데 바꾸고나면 Exception 떠버림

뭐가 문제임???