Question

I want to be able to do something like this:

IO.Directory.Exists("%USERPROFILE%")

The reason being that I want to specify one of the directories which my application will use, as plain text in a config file. In some cases I will want it to be nested under the user profile, in which case the config file would read something like:

...
LocalDbDirectory = %USERPROFILE%\Application Data\My Toolkit\
...

Or I might want it to be in a network location, in which case it would read something like:

...
LocalDbDirectory = N:\Common\My Toolkit Databases\
...

So I need to be able to interpret the shorthand notation with methods such as IO.Directory.Exists(...) or equivalent.

Any ideas?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top