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

node.js - How to mock a third-party api calls in the backend -

java - Could not locate OpenAL library -

Non Unique Username with ASP.Net Identity 2.0 -