Пример #1
0
 private void dropAction(object sender, DragEventArgs e)
 {
     string[] paths = (string[])e.Data.GetData(DataFormats.FileDrop);
     SQLiteUtils.path = paths[0];
     SQLiteUtils.pass = null;
     object[,] ret;
     try
     {
         ret = SQLiteUtils.select(SQLiteUtils.CMD_ALLTABLES);
         this.textBox_log.Text = string.Join(",", this.makeTablesStr(ret));
     }
     catch (Exception)
     {
         try
         {
             Form_inputText form = new Form_inputText();
             if (form.ShowDialog() == DialogResult.OK)
             {
                 SQLiteUtils.pass = form.textBox_input.Text;
                 ret = SQLiteUtils.select(SQLiteUtils.CMD_ALLTABLES);
                 this.textBox_log.Text = string.Join(",", this.makeTablesStr(ret));
             }
         }
         catch (Exception ex2)
         {
             MessageBox.Show(string.Format("Error : {0}", ex2.Message));
         }
     }
 }
Пример #2
0
        private void setPasswordPToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (SQLiteUtils.path != null)
            {
                Form_inputText form = new Form_inputText();
                if (form.ShowDialog() == DialogResult.OK)
                {
                    SQLiteUtils.setPassword(form.textBox_input.Text);
                    SQLiteUtils.pass = form.textBox_input.Text;
                    MessageBox.Show("changed password");
                }
                else
                {
                    MessageBox.Show("no opened file.");
                }

            }
        }