سؤال

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.

هل كانت مفيدة؟

المحلول

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)

نصائح أخرى

Make sure FileDialog.RestoreDirectory = false; this should solve your problem.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top