environment variables - Specifically Getting the System TEMP Path in C# -
i using system.io.path.gettemppath()
method retrieve temporary folder environment variables. however, finding return temp or tmp variable current user if exists otherwise return system temp or tmp variable.
is there way system temp variable?
i aware of several other questions on path.gettemppath() method answers referencing documentation msdn how method decides return. aware of behavior of method msdn , asking if there way ensure getting system temporary folder.
perhaps looking environment.getenvironmentvariable method.
this usage gives user's %temp% folder:
environment.getenvironmentvariable("temp");
such c:\users\myusername\appdata\local\temp
and gives system's %temp% folder:
environment.getenvironmentvariable("temp", environmentvariabletarget.machine);
such c:\windows\temp
Comments
Post a Comment