System.Windows.Forms.FileDialog.InitialDirectory Property

Gets or sets the initial directory displayed by the file dialog box.

Syntax

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

Value

Documentation for this section has not yet been entered.

Remarks

The FileDialog.InitialDirectory property is typically set using one of the following sources:

  • A path that was previously used in the program, perhaps retained from the last directory or file operation.

  • A path read from a persistent source, such as an application setting, a Microsoft.Win32.Registry or a string resource in the application.

  • Standard Windows system and user paths, such as Program Files, MyDocuments, MyMusic, and so on (which you can obtain using the Environment.GetFolderPath(System.Environment.SpecialFolder) method)

  • A path related to the current application, such as its startup directory (which you can obtain using properties on the System.Windows.Forms.Application object).

For more information about creating dynamic paths, see the System.Windows.Forms.FileDialog class overview.

On wiprlhext, if FileDialog.InitialDirectory is set to a full file name instead of just a directory path, the initial directory will default either to the application path, or to the directory from which the user last selected a file.

Requirements

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