예제 #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            killP();
            Thread.Sleep(200);
            string name     = "test1113";
            string birthday = "2018-07-20";
            string location = "wh";
            string sex      = "男";
            string sql      = string.Format("INSERT INTO patient VALUES (NULL, '{0}', '{1}', '{2}', '中国', NULL, NULL, NULL, NULL, NULL, 0, 0, 0, '{3}', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, 0, 0, 0, 0, 10, 0, 0, 76, 88, 85, 91, 98, 64, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 1, 1, 1, 1, 1, 2, NULL, NULL, NULL);", name, birthday, location, sex);
            string clearSql = "Delete from patient";
            string dbpath   = "C:\\Clasp32\\DATA\\data.db3";

            try
            {
                AgentDll.exec_sql(dbpath, clearSql);
                WriteLog("清除成功");
                Thread.Sleep(100);
                AgentDll.exec_sql(dbpath, sql);
            }
            catch (Exception ex)
            {
                MessageBox.Show("dbAgent数据插入失败" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                WriteLog("dbAgent数据插入失败" + ex.ToString());
                return;
            }
        }
예제 #2
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         AgentDll.launchEx(false);
     }catch (Exception ex)
     {
         MessageBox.Show("Agent启动失败" + ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
         WriteLog("Agent启动失败" + ex.ToString());
     }
 }