Esempio n. 1
0
        public void Form2_GetOKMessage()
        {
            List <String> OKWordList;
            ReadWriteFile rFile = new ReadWriteFile();

            OKWordList = rFile.readFile(System.AppDomain.CurrentDomain.BaseDirectory + @"\" + level + @"_ok.txt");
            for (int i = 0; i < OKWordList.Count; i++)
            {
                OKWordListStr = OKWordListStr + "+" + OKWordList[i];
            }
            OKWordListStr = OKWordListStr + "+";
            OKWordListStr = OKWordListStr.Replace("++", "+");
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            // レーベルが選択されない場合
            if (!this.radioButton4.Checked &&
                !this.radioButton3.Checked &&
                !this.radioButton2.Checked &&
                !this.radioButton1.Checked)
            {
                MessageBox.Show("Levelを設定してください");
                return;
            }

            // 時間が設定されない場合
            if (!Util.isNumberic(this.textBox1.Text, out delayTime))
            {
                MessageBox.Show("時間を設定してください");
                return;
            }

            if (!Util.isNumberic(this.textBox2.Text, out delayTime2))
            {
                MessageBox.Show("時間を設定してください");
                return;
            }

            int level = 3;

            if (this.radioButton4.Checked)
            {
                level = 4;
            }
            else if (this.radioButton3.Checked)
            {
                level = 3;
            }
            else if (this.radioButton2.Checked)
            {
                level = 2;
            }
            else if (this.radioButton1.Checked)
            {
                level = 1;
            }

            Configuration cfa = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            cfa.AppSettings.Settings["textBox1"].Value  = this.textBox1.Text;
            cfa.AppSettings.Settings["textBox2"].Value  = this.textBox2.Text;
            cfa.AppSettings.Settings["comboBox1"].Value = this.comboBox1.SelectedIndex + "";
            cfa.AppSettings.Settings["comboBox2"].Value = this.comboBox2.SelectedIndex + "";
            cfa.AppSettings.Settings["level"].Value     = level + "";
            cfa.Save();

            // 最小化 到 任务栏
            this.WindowState         = FormWindowState.Minimized;
            this.ShowInTaskbar       = false;
            this.notifyIcon1.Icon    = this.Icon;
            this.notifyIcon1.Visible = true;

            status = 1;


            ReadWriteFile rFile = new ReadWriteFile();

            wordList = rFile.readFile(System.AppDomain.CurrentDomain.BaseDirectory + @"\" + level + @".txt");

            if (messageWin == null || messageWin.IsDisposed)
            {
                messageWin = new Form2();
                messageWin.Show();

                messageWin.level = level;
                messageWin.Form2_GetOKMessage();

                //thread start
                messageThread = new Thread(popWinThread);
                messageThread.Start();
            }
        }