예제 #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            con.send("list databases;");
            String js = con.receive();

            // cfg.databaseName 在返回的列表中,设置,否则报错
            lblDatabaseName.Text = cfg.databaseName;
            this.refreshTree(null, null);//怎么传参数进去?
            //TODO refresh UIs
            //1.left top info
            //2.table tree
            //  * use refreshTree(object sender, EventArgs e)
        }
예제 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            //confirm_btn
            con.send(textBox1.Text);
            string  res    = con.receive();
            JObject jr     = JSON.fromJson(res);
            string  ok     = jr["ok"].ToString();
            string  result = jr["result"].ToString();

            if ("0".Equals(ok))
            {
                MessageBox.Show(result); return;
            }
            else
            {
                MessageBox.Show("success");
            }
            this.Close();
        }