Example #1
0
        private void simpleButton2_Click_1(object sender, EventArgs e)
        {
            if (this.textEdit1.Text.Trim().Equals(string.Empty))
            {
                MessageBox.Show("请输入报警界限");
                this.textEdit1.Focus();
                return;
            }
            if (this.textEdit1.Text.Trim().Equals(string.Empty))
            {
                MessageBox.Show("报警界限的格式输入有误");
                this.textEdit1.Focus();
                return;
            }
            if (this.textEdit2.Text.Trim().Equals(string.Empty))
            {
                dropDownButton1.Text = "斗地主";
                textEdit2.Text       = Application.StartupPath + @"\resources\UserMonitorResource\music\斗地主.wav";
            }


            //修改配置文件
            SystemConfig.WriteConfigData("user_warning_count", this.textEdit1.Text.Trim());
            SystemConfig.WriteConfigData("music_url", this.textEdit2.Text);
            myMethodDelegate mydelegate = new myMethodDelegate(Form1.soundplyStop);

            mydelegate += Form1.initialize_warning_count;
            mydelegate.Invoke();
            this.Close();
            //    MessageBox.Show("成功保存到配置文件" + Application.StartupPath + "\\plugin\\SystemConfig.xml \n点击读取按钮进行读取!");
        }
Example #2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (Judge_UserCount())
            {
                try { sp.Play(); }
                catch (Exception) { MessageBox.Show("请检查配置文件或者音频丢失!"); }

                SystemConfig.WriteConfigData("music_url", Application.StartupPath + @"\control\resouse\UserMonitorResource\music\斗地主.wav");
            }
        }
Example #3
0
 /// <summary>
 /// 初始话全局报警阈值
 /// </summary>
 public static void initialize_warning_count()
 {
     //   string s = SystemConfig.GetConfigData("user_warning_count", string.Empty);
     try
     {
         user_warning_count = Int32.Parse(SystemConfig.GetConfigData("user_warning_count", string.Empty));
     }catch (Exception) {
         MessageBox.Show("您上次设置的报警界限不合法,请重新设置!现在默认为1000");
         user_warning_count = 1000;
         SystemConfig.WriteConfigData("user_warning_count", "" + 1000);
     }
 }