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

Popular posts from this blog

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -