Example #1
0
        public void Realizar_Restore()
        {
            frm_Manutencao frm = new frm_Manutencao();

            Script_sql = frm.Arquivo_sql;

            // string strRestoreNome = db_caminhoBackup + Script_sql;
            string strRestoreNome = Script_sql;

            try
            {
                StreamReader sr    = new StreamReader(strRestoreNome);
                string       stdin = sr.ReadToEnd();
                sr.Close();

                ProcessStartInfo psinfo = new ProcessStartInfo();
                psinfo.FileName = frm_Manutencao.caminho_instalacao_Mysql + "\\mysql";
                psinfo.RedirectStandardInput  = true;
                psinfo.RedirectStandardOutput = false;
                psinfo.Arguments       = ("--host=localhost --user=root --password=34362377rr condo_biometry");//Acesso ao banco
                psinfo.UseShellExecute = false;

                Process Iniciar_Restore = Process.Start(psinfo);
                Iniciar_Restore.StandardInput.WriteLine(stdin);
                Iniciar_Restore.StandardInput.Close();
                Iniciar_Restore.WaitForExit();
                Iniciar_Restore.Close();

                MessageBox.Show("RESTAURAÇÃO REALIZADA COM SUCESSO!" + "\n" + "ORIGEM DE ARQUIVO:  " + strRestoreNome, "SUCESSO",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (IOException ex)
            {
                MessageBox.Show("Não foi possível restaurar base de dados! " + "\n" + ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
        private void btn_manutencao_Click(object sender, EventArgs e)
        {
            frm_Manutencao frm = new frm_Manutencao();

            frm.Show();
        }