Call ShowDialog method to show the dialog : SaveFileDialog « GUI Windows Form « C# / C Sharp






Call ShowDialog method to show the dialog

 



using System;
using System.Windows.Forms;

class MainClass {
    static void Main(string[] args) {
        SaveFileDialog dlg = new SaveFileDialog();

        if (dlg.ShowDialog() == DialogResult.OK) {
            Console.WriteLine(dlg.FileName);
        }
    }
}

 








Related examples in the same category

1.Use Filter in SaveFileDialog to filter file extension
2.Set CheckFileExists to true
3.Set InitialDirectory for SaveFileDialog