SaveFileDialog sfd = new SaveFileDialog(); //默认打开的路径 sfd.InitialDirectory = "C:\\Users\\Administrator\\Desktop"; sfd.FileName = "文件名.xls"; sfd.Filter = "Excel 工作薄(*.xls)|*.xls"; //设置默认文件类型显示顺序 sfd.FilterIndex = 1; //保存对话框是否记忆上次打开的目录 sfd.RestoreDirectory = true; //显示对话框 sfd.ShowDialog();
时间: 2024-10-02 01:35:04