temp directory

G

Guest

hey all,

is there a way in vb.net code to access whatever temp folder location any pc
is pointing to?

thanks,
rodchar
 
C

Cerebrus

Hi,

If by the temp folder you are referring to the folder which opens when
I type %temp% in the Run field and is located at :

C:\Documents and Settings\<UserName>\Local Settings\Temp

Then you can use the GetEnvironmentVariable method of the Environment
class as :
--------------------------
Dim path As String = Environment.GetEnvironmentVariable("Temp")
Process.Start(path)
--------------------------

If you mean the Temporary Internet Files folder, then you can simply
use the GetFolderPath method of the Environment class with the Enum
value "InternetCache".

HTH,

Regards,

Cerebrus.
 

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