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