System.Windows.Forms.FileDialog.FileName Property

Gets or sets a string containing the file name selected in the file dialog box.

Syntax

[System.ComponentModel.DefaultValue("")]
public string FileName { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The file name includes both the file path and the extension. If no files are selected, this method returns an empty string ("").

When used from the System.Windows.Forms.SaveFileDialog class, this property represents the file being saved; when used from the System.Windows.Forms.OpenFileDialog class, it represents the file being opened.

This property can only be the name of one selected file. If you want to return an array containing the names of all selected files in a multiple-selection dialog box, use FileDialog.FileNames.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0