c# - Using .files/.folders with Mono on Linux -


i'm writing c# application on linux, , i'd store applications .config files in user's home directory, i.e.

if application's name foo.exe

~user/.foo/foo.exe.config 

instead of looking .config file in same directory assembly. possible?

sure. environment.specialfolder.

string appdatadir = environment.getfolderpath(environment.specialfolder.applicationdata);

remember use path.combine(folder1, folder2) combine paths in order make app cross platform compatible.

alternatively environment variable home:

string homedir = system.environment.getenvironmentvariable("home");

Comments

Popular posts from this blog

python - Why doesn't list have safe "get" method like dictionary? -

razor - Is this a bug in WebMatrix PageData? -

sql server - Stored procedure -