Where to store "recent files"

  • Thread starter Thread starter cpnet
  • Start date Start date
C

cpnet

In my old unmanaged apps, I'd store a list of "recent files" in the HKCU
registry hive, so that I could display the last 4 opened files on the "File"
menu of my app. And, this was specific to each user.

I'm not sure where I should be storing something like this in a managed (C#)
app? App.config doesn't seem to be user specific. Should I still be using
the registry for this, or does this now belong somewhere else?
 
Hi cpnet,

Application.UserAppDataPath or Application.UserAppDataRegistry might be what you are looking for.
 
Thanks to all that responded. I ended up just using the registry so that I
wouldn't have to deal with reading/writing to a file. However, I ended up
building my own variation of Application.UserAppDataRegistry to get the root
path for my registry values. Application.UserAppDataRegistry includes the
whole version number as part of the registry path it provides, but I just
wanted to include the Major and Minor parts of the version so that I'm not
creating a whole set of new registry keys every time my build or revision
number changes. Anyway, it seems to be working well.
 
For my applications, I write out an XML file that contains the nodes and
values for any settings that my application requires. This paradigm has
worked very well for me.

Jason
 
Back
Top