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
Post a Comment