openfiledialog的RestoreDirectory 属性问题

MSDN上的解释是
Gets or sets a value indicating whether the dialog box restores the current directory before closing.
应该是是否恢复current directory,而不是打开对话框时的目录
对应的变量是Environment.CurrentDirectory:如果RestoreDirectory设置为true,Environment.CurrentDirectory不会随对话框所选择的目录而改变;反之Environment.CurrentDirectory就会改变了。

 

所以,最后的解决办法还是把FileDialog.InitialDirectory 属性去掉。

posted @ 2017-07-05 14:26  SkyLeo  阅读(237)  评论(0编辑  收藏  举报