0

I wrote an app in C# which allows user to select a directory and does some simple things on the files in the directory. Now I want to add a ListBox to it that saves the most recent 5 selected directories. I don't want to hook up my app to a db because it's a very simple app. I can save the values to a txt file but I don't think that's the best practice. Is there any built-in features in Visual Studio Windows Form Application which allows me to do that? (I tried *.resx file and it doesn't seems to work for such purpose.)

GoCurry
  • 899
  • 11
  • 31

1 Answers1

4

The use of Settings can do this feature. It is so sample just go to the project properties and add a new propertie with type StringCollection . You can manipulate this propertie like a sample collection by add ‚remove paths. Take a look in this tutorial : http://blog.csharphelper.com/2011/08/18/use-a-setting-that-contains-a-string-collection-in-c.aspx