34 lines
993 B
C#
34 lines
993 B
C#
namespace BugSaveFileDialog
|
|
{
|
|
public partial class Form1 : Form
|
|
{
|
|
public Form1()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
{
|
|
var saveDialog = new SaveFileDialog
|
|
{
|
|
AddExtension = true,
|
|
CheckPathExists = false,
|
|
CheckFileExists = false,
|
|
CreatePrompt = false,
|
|
OverwritePrompt = true,
|
|
DereferenceLinks = true,
|
|
DefaultExt = "my",
|
|
Filter = "My files (*.my)|*.my",
|
|
RestoreDirectory = true,
|
|
Title = "Create a my file",
|
|
};
|
|
|
|
var dialogResult = saveDialog.ShowDialog(this);
|
|
if (dialogResult == DialogResult.OK)
|
|
{
|
|
var filePath = saveDialog.FileName;
|
|
MessageBox.Show(filePath);
|
|
}
|
|
}
|
|
}
|
|
} |