public static string SetSaveFilePath(string filterType= "所有文件|*.*",string fileName="我的文件",string defaultExt=".txt")
        {
            SaveFileDialog dialog = new SaveFileDialog();
            dialog.Filter = filterType;       //设置文件类型
            dialog.FileName = fileName;                               //设置默认文件名
            dialog.DefaultExt = defaultExt;                              //设置默认格式(可以不设)
            dialog.AddExtension = true;                             //设置自动在文件名中添加扩展名
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                return dialog.FileName;
            }
            return "";
        }

相关文章:

  • 2022-12-23
  • 2021-10-27
  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
  • 2022-12-23
  • 2021-05-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-01
相关资源
相似解决方案