File Open dialog box is not going to right directory in c# application on windows xp
-
01-07-2021 - |
Question
I have created an application in C#/visual studio 2010.
In that application, i have some background images for software.when i select to change the background of software, it goes to that folder for file selection.
It is working well on win7, but it is not working on winxp on client's system.He says that it goes to last opened folder.
I have set the initial directory path but not working on xp.
La solution
Sounds like you need to set the InitialDirectory property of the Dialog.
Setting it to something like 'My Documents' can be done by setting it to:
openFileDialog1.InitialDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments)
Autres conseils
Make sure FileDialog.RestoreDirectory = false; this should solve your problem.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow