1,SaveFileDialog控件的属性Filter 要在对话框中显示的文件筛选器,例如,\"文本文件(*.txt)|*.txt|所有文件(*.*)|*.*\" ;
2,SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.Filter = "导出Excel (*.xls)|*.xls";
saveFileDialog.FileName = DateTime.Now.ToString("销售统计yyyyMMddhhmmss");
saveFileDialog.FilterIndex = 0;
saveFileDialog.RestoreDirectory = true;
//saveFileDialog.CreatePrompt = true;
saveFileDialog.Title = "导出文件保存路径";
//saveFileDialog.ShowDialog();
if (saveFileDialog.ShowDialog() == DialogResult.OK)
|