//backgroudwork
 private void getstauts(object sender, System.ComponentModel.DoWorkEventArgs e)
 {
     try
     {
         while (iscangetstatus)
         {
             if (this.testDevice.StylusStatue() && ismoveative == false)
             {
                 if (thiscard)
                 {
                     Settings.Default.num--;
                     this.ismoveative = getevent();
                     if (!isBabyYiNing)
                     {
                         Checkpicture checkpicture = new Checkpicture(tbSavePath.Text, Settings.Default.num + xYrulescs.Name, true, numericUpDown1.Value);
                         checkpicture.ShowDialog();
                     }
                     thiscard = false;
                     Settings.Default.num++;
                 }
                 else
                 {
                     this.ismoveative = getevent();
                     Settings.Default.num++;
                 }
             }
             Thread.Sleep(200);
         }
         e.Cancel = true;
     }
     catch (Exception ex)
     {
         Loghelper.WriteLog("获取箱体按钮状态失败", ex);
     }
 }
        private void btnDetectPath_Click(object sender, EventArgs e)
        {
            System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog();
            dialog.Description = "请选择文件夹";
            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (string.IsNullOrEmpty(dialog.SelectedPath))
                {
                    MessageBox.Show(this, "文件夹路径不能为空", "提示");
                    return;
                }

                Checkpicture checkpicture = new Checkpicture(dialog.SelectedPath, null, false, numericUpDown1.Value);
                checkpicture.ShowDialog();
            }
        }