private void button12_Click(object sender, EventArgs e)
{
#region oracle数据库备份
System.Diagnostics.Process pro = new System.Diagnostics.Process();
pro.StartInfo.FileName = "cmd.exe ";
pro.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
pro.StartInfo.CreateNoWindow = true;
pro.StartInfo.UseShellExecute = false;
pro.StartInfo.RedirectStandardInput = true;
pro.StartInfo.RedirectStandardOutput = true;
pro.Start();
//pro.StandardInput.WriteLine("exp lc1002/cccccc@orcl file=lc100220101113.dmp owner=lc1002");
pro.StandardInput.WriteLine("exp " + textBox2.Text + "/" + textBox3.Text + "@" + textBox1.Text + " file=" + textBox4.Text + textBox2.Text + ".dmp" + " owner=" + textBox2.Text);
pro.StandardInput.WriteLine("exit");
string outPut = pro.StandardOutput.ReadToEnd();
this.textBox4.Text = outPut; MessageBox.Show("ORACLE数据库备份完成!", "提示"); #endregion
}运行后可以成功备份数据,但是textBox4只显示运行cmd.exe和exit了。没有显示平时在DOS下执行exp.exe时在屏幕上输出的详细内容,像导出的表名,导出了多少行等等。请各位老师帮忙看看,谢谢!
{
#region oracle数据库备份
System.Diagnostics.Process pro = new System.Diagnostics.Process();
pro.StartInfo.FileName = "cmd.exe ";
pro.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
pro.StartInfo.CreateNoWindow = true;
pro.StartInfo.UseShellExecute = false;
pro.StartInfo.RedirectStandardInput = true;
pro.StartInfo.RedirectStandardOutput = true;
pro.Start();
//pro.StandardInput.WriteLine("exp lc1002/cccccc@orcl file=lc100220101113.dmp owner=lc1002");
pro.StandardInput.WriteLine("exp " + textBox2.Text + "/" + textBox3.Text + "@" + textBox1.Text + " file=" + textBox4.Text + textBox2.Text + ".dmp" + " owner=" + textBox2.Text);
pro.StandardInput.WriteLine("exit");
string outPut = pro.StandardOutput.ReadToEnd();
this.textBox4.Text = outPut; MessageBox.Show("ORACLE数据库备份完成!", "提示"); #endregion
}运行后可以成功备份数据,但是textBox4只显示运行cmd.exe和exit了。没有显示平时在DOS下执行exp.exe时在屏幕上输出的详细内容,像导出的表名,导出了多少行等等。请各位老师帮忙看看,谢谢!
解决方案 »
- Convert.ToBase64String(Encoding.Unicode.GetBytes(userName))
- 想请教个问题C#
- C#跟数据连接异常~~谢谢!!
- 【咨询】短信猫怎么使用,价格如何?
- 请大家帮忙看看我的程序
- ARRAYLIST如何进行排序
- 定时器的启动问题(比较怪异,这种方式就是触发不了)
- exe文件调用web页面返回错误,但是页面访问没有问题
- 送分,string[]问题;
- 一个关于复杂TreeView的问题,有经验的人指点一下。
- C#里调用dll(java编写,用ivkm工具生成dll)函数传参的问题
- 多线程录音并进行MP3编码时报错:未处理的AccessViolationException:尝试读取或写入受保护的内存。者通常指示其他内存已损坏。
Proccess其他的exe都可以,但是exp.exe和imp.exe就是不行
LZ你是怎么解决的呢?
求指教