C#怎么编的文件备份,是用哪个类呢 ?
我想编系统备份,跟备份文件是一样吧 --------------------编程问答-------------------- 我这里有个备份系统的代码你拿去参考下把:try
{
string strg = Application.StartupPath.ToString();
strg = strg.Substring(0, strg.LastIndexOf("\\"));
strg = strg.Substring(0, strg.LastIndexOf("\\"));
strg += @"\Data";
string sqltxt = @"BACKUP DATABASE db_MrCy TO Disk='" + strg + "\\" + textBox1.Text + ".bak" + "'";
SqlConnection conn = BaseClass.DBconn.Lj();
conn.Open();
SqlCommand cmd = new SqlCommand(sqltxt, conn);
cmd.ExecuteNonQuery();
conn.Close();
if (MessageBox.Show("备份成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) == DialogResult.OK)
{
this.Close();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
} --------------------编程问答-------------------- 这个就可以备份么?是拷贝路径么?
补充:.NET技术 , 其他语言