private void btnExportAllToOne_Click(object sender, EventArgs e) { SaveFileDialog dlg = new SaveFileDialog(); dlg.RestoreDirectory = true; dlg.Filter = "Excel Xml(*.xml)|*.xml"; //saveFileDialog1.Title = "保存"; if (dlg.ShowDialog() == DialogResult.OK) { ADUtils.ExportAllToXmlFile(dlg.FileName); } }
private void btnBackup_Click(object sender, EventArgs e) { FolderBrowserDialog dlg = new FolderBrowserDialog(); if (dlg.ShowDialog() == DialogResult.OK) { System.IO.StreamWriter sw = new System.IO.StreamWriter(dlg.SelectedPath + "\\ViewFuncs.sql", false, Encoding.UTF8); System.Data.DataTable dt = Feng.Data.DbHelper.GetViewFuncProcTrigs(); foreach (System.Data.DataRow row in dt.Rows) { sw.WriteLine(row["definition"].ToString()); } sw.Close(); ADUtils.ExportAllToXmlFile(dlg.SelectedPath + "\\ADInfos.xml"); } }