private void button_saveUser_Click(object sender, EventArgs e)
        {
            string UserName = textBox_YHUserName.Text;
            string Password = textBox_YHPassword.Text;

            DBHelperSQLite.ExecuteSql("update t_User set UserName='******'" + ",Password = '******' WHERE clientType='YH'");
        }
        private void button_selectDZHPath_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog dialog = new FolderBrowserDialog();

            dialog.Description = "请选择大智慧安装目录";
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                if (string.IsNullOrEmpty(dialog.SelectedPath))
                {
                    return;
                }
                textBox_dzhPath.Text = dialog.SelectedPath;
                dzhPath = dialog.SelectedPath;
                DBHelperSQLite.ExecuteSql("update t_sysConfig set configValue='" + dzhPath + "' WHERE configName='dzhPath'");
            }
        }
        private void MainForm_Load(object sender, EventArgs e)
        {
            GetAllDesktopWindows();
            string en_US = "00000409"; //英文
            //string cn_ZH = "00000804";
            uint KLF_ACTIVATE = 1;

            PostMessage(0xffff, 0x00500, IntPtr.Zero, LoadKeyboardLayout(en_US, KLF_ACTIVATE));//屏蔽中文输入法

            CheckBuyTimer.Elapsed += delegate
            {
                Thread thread = new Thread(CheckBuy);
                thread.SetApartmentState(ApartmentState.STA);//要在线程里使用剪切板,必须设为STA模式
                thread.Start();
            };
            CheckBuyTimer.AutoReset = true; //每到指定时间Elapsed事件是触发一次(false),还是一直触发(true)
            CheckSellTimer.Elapsed += delegate
            {
                Thread thread = new Thread(CheckSell);
                thread.SetApartmentState(ApartmentState.STA);//要在线程里使用剪切板,必须设为STA模式
                thread.Start();
            };
            CheckSellTimer.AutoReset = true; //每到指定时间Elapsed事件是触发一次(false),还是一直触发(true)
            CheckSellTimer.Start();
            CheckClientTimer.Elapsed += delegate
            {
                Thread thread1 = new Thread(CheckClient);
                //thread1.SetApartmentState(ApartmentState.STA);
                thread1.Start();
            };
            CheckClientTimer.AutoReset = true; //每到指定时间Elapsed事件是触发一次(false),还是一直触发(true)
            CheckClientTimer.Start();

            DataSet data = DBHelperSQLite.Query("select * from t_user WHERE clientType='YH'");

            if (data.Tables[0].Rows.Count > 0)
            {
                username = Convert.ToString(data.Tables[0].Rows[0]["Username"]);
                password = Convert.ToString(data.Tables[0].Rows[0]["Password"]);
                textBox_YHUserName.Text = username;
                textBox_YHPassword.Text = password;
            }
            DataSet sysData = DBHelperSQLite.Query("select * from t_sysconfig");

            if (sysData.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dataRow in sysData.Tables[0].Rows)
                {
                    switch (Convert.ToString(dataRow["configName"]))
                    {
                    case "dzhPath":
                        dzhPath = Convert.ToString(dataRow["configValue"]);
                        textBox_dzhPath.Text = dzhPath;
                        break;

                    default:
                        break;
                    }
                }
            }

            //getStockNowPrice(new List<string>(){ "sh601006","sh601007"});
        }