When I use the OpenFileDialog to pick a file, it remembers the last visited directory so that when I go back to the dialog, it starts in that location by default.
But the FolderBrowserDialog does not start at that location and instead starts at the specified RootFolder.
So I would like to know where does OpenFileDialog store the last visited path so I can retrieve it and use it as the default location for FolderBrowserDialog.
First, make sure that the property
RestoreDirectory
of theOpenFileDialog
is set to false. Then you can check the value ofEnvironment.CurrentDirectory
to get the most recent one. Hope this may help.