I have to rewrite some old code and I'm wondering the best way to handle a long list of strings. The list is comprised of around 100 items, and each item is used to match a folder which may contain several files that will be added to a zip archive which will be named "[parentfolder].zip"
The current code looks something like this:
string[5] list = {"a", "b", "c", "d", "e"};
for (int i = 0; i < 5; i++){
// open folder for list[i]
if (Directory.Exists(string.Format("c:\\{0}", i))){
// get files and add them to list[i].zip
// do some work with archive
}
}
The list of folder names is not likely to change, but there is a small possibility that it will.
My question is what would be the best way to handle the list of folders? An array of strings is obviously not optimal. I was thinking of using an Enum, but would welcome any other suggestions as this 'list' seems like it could be easy to make errors in
(the item names are usually only three letters btw)
Sorry if this seems like a dumb question ;)
EDIT: orginally stated that the list of names is not likely to change, this was very badly stated as there is a small chance that the list will be added to.