I'm working in C# and can get the SaveFileDialog to reset to the InitialDirectory in Windows XP, but the same code does not work in Windows 7. Every time the dialog comes up in Windows 7, it opens to the last directory saved to or opened from instead of the directory I am setting as the initial directory. I have tried changing the RestoreDirectory setting and setting AutoUpgradeEnabled to false, but neither have worked.
I cannot provide a code sample, but I can give you an idea of what's happening:
Every time the user tries to save a file that is in use by someone else, they are given the option to save as. If they click yes, a new SaveFileDialog is created with the initial directory set and RestoreDirectory set to false. The issue is that the dialog that pops up is not opening to the initial directory.
My question is: Are there any known problems where this does not work in Windows 7 or Vista? If not, can some pointers be given for what to look for to fix this issue? Do I have to only have one SaveFileDialog object created during this process and not have it be local to the method?
Thank you.
来源:https://stackoverflow.com/questions/7001164/any-known-problems-with-getting-savefiledialogs-initialdirectory-property-worki