简体   繁体   English

Windows XP上的C#应用​​程序中的“文件打开”对话框不会转到正确的目录

[英]File Open dialog box is not going to right directory in c# application on windows xp

I have created an application in C#/visual studio 2010. 我已经在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. 在这种应用中,我有我software.when选择来改变软件的一些背景背景图像,它进入该文件夹的文件选择。

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. 它在win7上运行良好,但在客户端系统上的winxp上运行不正常。

I have set the initial directory path but not working on xp. 我已经设置了初始目录路径,但无法在XP上运行。

Sounds like you need to set the InitialDirectory property of the Dialog. 听起来您需要设置对话框的InitialDirectory属性。

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; 确保FileDialog.RestoreDirectory = false; this should solve your problem. 这应该可以解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM