c# - Path.GetTempPath() always returns %USERPROFILE% -


i've written program calls system.io.path.gettemppath() function. documentation i've read (like one) says function should return first path found list:

  • the path specified tmp environment variable.
  • the path specified temp environment variable.
  • the path specified userprofile environment variable.
  • the windows directory.

i have defined both tmp , temp environment variables %userprofile%\appdata\local\temp, call gettemppath() returns %userprofile% directory instead of values i've define tmp , temp. how can function return temporary directory i've defined?

that environment setting. http://msdn.microsoft.com/en-us/library/77zkk0b6.aspx

var tmp = environment.getenvironmentvariable("tmp"); 

update: went command prompt , did

set tmp=c:\temp 

then launched visual studio command prompt. environment updated , visual studio sees it. code above (as yours) worked me. displayed updated environment settings.

so believe have kill explorer or logoff in order new environment seen permenantly.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -