How to save last folder in openFileDialog?

前端 未结 8 1952
刺人心
刺人心 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:21

    After changing Settings you have to call

    Settings.Default.Save();
    

    and before you open the OpenFileDialog you set

    openFileDialog1.InitialDirectory = Settings.Default.acc_path;
    

提交回复
热议问题