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时在屏幕上输出的详细内容,像导出的表名,导出了多少行等等。请各位老师帮忙看看,谢谢!
解决方案 »
- 字符转译
- 初始化界面时,如何将光标定位到用户控件中textBox中
- 数据集之间可以相互赋值
- WebRequest.Create请求页面
- 帮忙做一下测试
- DataTable 中数据操作的问题!
- 我的OUTLOOK出问题了麻烦大家来想想办法如何解决阿
- Telerik.WebControls RadUpload 大附件到100%卡住的问题
- 谁给点想法,选择几个线程,然后在窗体上绘制几个对应的进度条
- 关于SQLDataAdapter1.Update(changerows)的问题?
- C#里调用dll(java编写,用ivkm工具生成dll)函数传参的问题
- 多线程录音并进行MP3编码时报错:未处理的AccessViolationException:尝试读取或写入受保护的内存。者通常指示其他内存已损坏。
Proccess其他的exe都可以,但是exp.exe和imp.exe就是不行
LZ你是怎么解决的呢?
求指教