Save file with appropriate extension in a Save File prompt
SaveFileDialog dlg = new SaveFileDialog();
dlg.Filter = "Data Files (*.dat)|*.dat";
dlg.DefaultExt = "dat";
dlg.AddExtension = true;
The AddExtension and DefaultExt properties. For example:
sfdialog.DefaultExt = "dat";
sfdialog.AddExtension = true;