SaveFileDialog dlg = new SaveFileDialog(); dlg.Filter = "Data Files (*.dat)|*.dat"; dlg.DefaultExt = "dat"; dlg.AddExtension = true;