FileDialog.DefaultExt Property
Gets or sets the default file name extension.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Property Value
Type: System.StringThe default file name extension. The returned string does not include the period. The default value is an empty string ("").
When the user of your application specifies a file name without an extension, the FileDialog appends an extension to the file name. The extension that is used is determined by the Filter and DefaultExt properties. If a filter is selected in the FileDialog and the filter specifies an extension, then that extension is used. If the filter selected uses a wildcard in place of the extension, then the extension specified in the DefaultExt property is used.
The following code example demonstrates using the RichTextBox.SaveFile and RichTextBox.LoadFile methods with streams. It also demonstrates using the FileName, DefaultExt, SaveFileDialog.CreatePrompt, and SaveFileDialog.OverwritePrompt members.
This is a complete example that is ready to run when you copy it to your project.
Available since 1.1