冰之印记

导航

RestoreDirectory 引起的BUG

IIRC, in windows XP when you press Save on a SaveFileDialog (or Open on a OpenFileDialog) the directory where the file is saved (or opened), is set as the new current working directory (the one in Environment.CurrentDirectory).

By setting FileDialog.RestoreDirectory = true, when you close the FileDialog the original working directory is restored.

In Windows Vista/Seven the behavior is always as FileDialog.RestoreDirectory = true (yes, even if you set it to false...).
 
 
设置过路径之后 导致应用程序中使用相对路径的地方全部出错,终于找到了答案。
 
http://stackoverflow.com/questions/4353487/what-does-the-filedialog-restoredirectory-property-actually-do

posted on 2013-09-06 10:47  冰之印记  阅读(250)  评论(0编辑  收藏  举报