Why the current working directory changes when use the Open file dialog in Windows XP?

后端 未结 2 737
孤城傲影
孤城傲影 2021-02-18 22:30

I have found an strange behavior when use the open file dialog in c#.

If use this code in Windows XP the current working directory changes to the path of t

2条回答
  •  梦毁少年i
    2021-02-18 23:14

    Based on your description it sounds like the default value of the RestoreDirectory property is different between XP and Windows7. I'm not sure why this would be the case but you can fix this problem by explicitly setting the value in your code. Setting it to true will restore the directory on dialog close.

提交回复
热议问题