As we know WPF OpenFileDialog no more changes the app’s working directory and RestoreDirectory property is “unimplemented”. However, upon subsequent open, its initial directory is default to the last opened file rather than the original working directory, so this information must be stored somewhere. I wonder is it possible to get/set it from user code?
As we know WPF OpenFileDialog no more changes the app’s working directory and RestoreDirectory
Share
On Windows 7 the recent file information is stored in the registry at this key:
Beneath this key are subkeys for the various file extensions (e.g.,
exe,docx,py, etc).Now, if you want to read these values, this will get a list of all paths stored beneath the subkeys (adapted from here):
References: