How to save last folder in openFileDialog?

This is the easiest way: FileDialog.RestoreDirectory.


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.


After changing Settings you have to call

Settings.Default.Save();

and before you open the OpenFileDialog you set

openFileDialog1.InitialDirectory = Settings.Default.acc_path;