Gets or sets a string containing the file name selected in the file dialog box.
[Visual Basic] Public Property FileName As String [C#] public string FileName {get; set;} [C++] public: __property String* get_FileName(); public: __property void set_FileName(String*); [JScript] public function get FileName() : String; public function set FileName(String);
A string containing the file name selected in the file dialog box. The default value is an empty string ("").
The file name includes both the file path and the extension. If no files are selected, this method returns an empty array.
This method can return only 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 the FileNames method.
FileDialog Class | FileDialog Members | System.WinForms Namespace | FileNames