Reading the set temp and set tmp environment or something equivalent

I

Ioannis Vranos

Is there any way to find out the current user's directory temp paths in
..NET applications?


For example to read the set variables which in my account are:


TEMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
TMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp



or another way to retrieve that information?
 
C

Carl Daniel [VC++ MVP]

Ioannis said:
Is there any way to find out the current user's directory temp paths
in .NET applications?


For example to read the set variables which in my account are:


TEMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
TMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp



or another way to retrieve that information?

For native C++, use getenv() from <stdlib.h>

For managed, use System::Environment::GetEnvironmentVariable from mscorlib.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top