滴水成河 发表于 2013-1-4 01:13:06

Winform中的oracle数据库备份功能

Winform中的oracle数据库备份功能

<div class="postText"><div id="cnblogs_post_body"><div class="cnblogs_code">string strbat = Application.StartupPath + "\\backup.bat";string oracleUserName = "myOracle";string oraclePwd = "mypwd";string backUpPath = "E:\\oracle\\backup.bmp"string myOracle = "orcl";                if (System.IO.File.Exists(strbat))                {                  System.IO.File.Delete(strbat);                }                try                {                  string strTemp = "cmd /c start cmd.exe /c exp " + oracleUserName + "/" + oraclePwd+ "@" + myOracle + " file=" + backUpPath + " exit";                  System.IO.StreamWriter file = new System.IO.StreamWriter(strbat, false, System.Text.Encoding.Default);                  file.Write(strTemp);                  file.Close();                  System.Diagnostics.Process p = new System.Diagnostics.Process();                  p.StartInfo.FileName = strbat;                  p.Start();                  this.Close();                }                catch (Exception err)                {                  MessageBox.Show(err.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Information);                }
页: [1]
查看完整版本: Winform中的oracle数据库备份功能