I have a OpenFileDialog which should open up a specific path say %ProgramData% when 'Browse' clicked for the first time the user uses the application. And for all successive terms, it should open up the last used folder.
I tried:
OpenFileDialog ofd = new OpenFileDialog();
ofd.InitialDirectory = "C:\ProgramData";
ofd.RestoreDirectory = true;
ofd.FileName = "";
DialogResult dr = ofd.ShowDialog();
The problem here is, it opens up "C:\ProgramData" every time, even if I change path while looking for the required file. Is there a specific property that I should set or do I have to programmatically keep track of the usage of the OpenFileDialog and set path accordingly?