Try this, the code below is commented
private void btnBackupDB_Click(object sender, EventArgs e)
{
string path = @"C:\backup";
string backupFileName = "mybackup.dmp";
string oracleHome = Environment.GetEnvironmentVariable("ORACLE_HOME");
string oracleUser = "sys";
string oraclePassword = "abc";
string oracleSID = "xe";
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = Path.Combine(oracleHome, "bin", "exp");
psi.RedirectStandardInput = false;
psi.RedirectStandardOutput = true;
string dumpFile = Path.Combine(path, backupFileName);
psi.Arguments = string.Format(oracleUser + "/" + oraclePassword + "@" + oracleSID + " FULL=y FILE=" + dumpFile);
psi.UseShellExecute = false;
Process process = Process.Start(psi);
process.WaitForExit();
process.Close();
MessageBox.Show("Database Backup Completed Successfully");
this.Close();
}
Edgar Rocha Carvalho