bool excuteEXP(string servicename, string nm, string pwd, string filename)
{
try
{
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardError = true;
//p.StartInfo.CreateNoWindow = true; p.Start();
//p.StandardInput.WriteLine("exp " + nm + "/" + pwd + "@" + servicename + " file=" + filename);
p.StandardInput.WriteLine("exp system/system@ora9207 file=d:\\sy.dmp log=d:\\sy.log");
//while (p.HasExited)
//{
//}
p.WaitForExit();
//string output = p.StandardOutput.ReadToEnd();
//label4.Text = output;
p.Close();
MessageBox.Show("备份成功"); return true;
}
catch (Exception xx)
{
MessageBox.Show(xx.Message);
return false;
}
}如题。
而且没有像直接打开命令行那样,显示导出表的信息。
新手,请高人指点
{
try
{
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardError = true;
//p.StartInfo.CreateNoWindow = true; p.Start();
//p.StandardInput.WriteLine("exp " + nm + "/" + pwd + "@" + servicename + " file=" + filename);
p.StandardInput.WriteLine("exp system/system@ora9207 file=d:\\sy.dmp log=d:\\sy.log");
//while (p.HasExited)
//{
//}
p.WaitForExit();
//string output = p.StandardOutput.ReadToEnd();
//label4.Text = output;
p.Close();
MessageBox.Show("备份成功"); return true;
}
catch (Exception xx)
{
MessageBox.Show(xx.Message);
return false;
}
}如题。
而且没有像直接打开命令行那样,显示导出表的信息。
新手,请高人指点
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货