How to save last folder in openFileDialog?

前端 未结 8 1949
刺人心
刺人心 2021-02-14 00:51

How do I make my application store the last path opened in openFileDialog and after new opening restore it?

OpenFileDialog openFileDialog1 = new Ope         


        
8条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-14 01:32

    I think it would be enough for you to use SetCurrentDirectory to ste the current directory for the OS. So on the next dialog opening it would pick that path.

    Or simply save path into some variable of your application and use
    FileDialog.InitialDirectory property.

提交回复
热议问题