The SaveFileDialog
class has a public FileName
property that allows you to get or set the file name displayed in the dialog box.
This is how you retrieve the file name that the user specified after they have dismissed the dialog box, but it is also the way that you specify a default file name that initially appears in the dialog box.
So before you call the SaveFileDialog.ShowDialog
method, just set the FileName
property to the desired file name. If you like, you can retrieve its current value, append a number to it, and set the property to the new string.