Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

SaveFileDialog initial directory and Search Results

$
0
0

Hi folks,

I'm running into a problem with the SaveFileDialog class.  I've been letting Windows remember the previous directory used by a common dialog (e.g. OpenFileDialog) and when the user does a save or save as, letting the dialog default to the directory from which they opened the last file.   This works beautifully, unless they've used the search feature of OpenFileDialog and the result returned files in more than one directory.  In this case, when they subsequently go to save the file, instead of the SaveFileDialog defaulting to the directory containing the opened file as you would expect, the SaveFileDialog opens in the 'search results' mode.  The path looks something like this:

search-ms:displayname=Search%20Results%20in%20ProcessApps&crumb=System.Generic.String%3ACRDM&crumb=location:C%3A%5CUsers%5Ctclement%5CDocuments%5CProcessApps

Obviously, if the user tries to save the file there, an error occurs indicating "You can't save here.  Please choose another location."

Am I right that this is a defect?  I realize I can get around this by circumventing the default behavior (i.e storing the previously opened location and setting the  InitialDirectory property myself), but does it bug anyone else that Windows default behavior would be to open a save dialog in search results that would result in an error if the user clicks OK?


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>