How to place a Windows special folder in config file
In my c# application I have a custom config section to determine where to
store and retrieve certain files. However the default location for these
is in the c:\ProgramData directory and we access it by using
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
How can I prepopulate that directory in my config file without having to
write out the raw string? It could also be a different special folder in
some cases as well.
Basically it is a configuration element that looks like:
<searchpath path="" priority="" isfullpath=""/>
Each one of those is a path to search for configuration profiles for a
product however over the course of different versions that directory has
been moved around, but for backwards compatibility I still need to search
the older paths if I can't find them in the newer paths.
For example I have to search in the product install directory then the
ProgramData directory now as our most recent version moved it into the
current products install directory, but our older version was storing it
in the ProgramData directory.
No comments:
Post a Comment