Поменял на savefiledialog

This commit is contained in:
Никита Потапов 2024-10-07 14:42:26 +04:00
parent e1d5ffe478
commit b78f933bd7

View File

@ -45,16 +45,16 @@ namespace WinFormsApp
{
var filePath = string.Empty;
using (OpenFileDialog openFileDialog = new OpenFileDialog())
using (SaveFileDialog saveFileDialog = new SaveFileDialog())
{
openFileDialog.InitialDirectory = "d:\\tmp";
openFileDialog.Filter = "Excel files (*.xlsx)|*.xlsx|All files (*.*)|*.*";
openFileDialog.FilterIndex = 1;
openFileDialog.RestoreDirectory = true;
saveFileDialog.InitialDirectory = "d:\\tmp";
saveFileDialog.Filter = "Excel files (*.xlsx)|*.xlsx|All files (*.*)|*.*";
saveFileDialog.FilterIndex = 1;
saveFileDialog.RestoreDirectory = true;
if (openFileDialog.ShowDialog() == DialogResult.OK)
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
filePath = openFileDialog.FileName;
filePath = saveFileDialog.FileName;
}
}