Setting the initial directory of an SaveFileDialog?

前端 未结 14 2200
一个人的身影
一个人的身影 2020-12-01 10:05

I\'d like a SaveFileDialog with the following behavior:

  • The first time you open it, it goes to \"My Documents\".

  • Afterwards, it goes to the

14条回答
  •  广开言路
    2020-12-01 10:53

    I found that setting InitialDirectory to null first works around user history.

        OpenFileDialog dlgOpen = new OpenFileDialog();
        dlgOpen.InitialDirectory = null;
        dlgOpen.InitialDirectory = @"c:\user\MyPath";
    

提交回复
热议问题