|
-
Oct 7th, 2003, 02:07 AM
#1
Thread Starter
Hyperactive Member
Finding the Windows Temp Folder [resolved]
Does anybody have any VB code that finds the windows temp folder?
Thanks in advance
Last edited by stingrae; Oct 7th, 2003 at 03:00 AM.
"The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.
Windows & Web Developer
Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
Sutherland Shire, Sydney Australia
www.stingrae.com.au
Developer of Arnold - Gym & Martial Arts Database Management System
www.gymdatabase.com.au
-
Oct 7th, 2003, 02:49 AM
#2
try this and see how you go ....
VB Code:
Private Declare Function GetTempPath Lib "kernel32.dll" Alias "GetTempPathA" (ByVal nBufferLength As Integer, ByVal lpBuffer As System.Text.StringBuilder) As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim s As New System.Text.StringBuilder(256)
GetTempPath(s.Capacity, s)
MessageBox.Show(s.ToString)
End Sub
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Oct 7th, 2003, 02:59 AM
#3
Thread Starter
Hyperactive Member
"The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.
Windows & Web Developer
Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
Sutherland Shire, Sydney Australia
www.stingrae.com.au
Developer of Arnold - Gym & Martial Arts Database Management System
www.gymdatabase.com.au
-
Oct 7th, 2003, 03:27 AM
#4
If you don't want to use an API then you can do this:
VB Code:
Environment.GetEnvironmentVariable("TEMP")
'you can get a bunch of other ones using GetFolderPath but temp isn't one of those
Environment.GetFolderPath(Environment.SpecialFolder.System)
-
Oct 7th, 2003, 04:06 AM
#5
Thread Starter
Hyperactive Member
"The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.
Windows & Web Developer
Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
Sutherland Shire, Sydney Australia
www.stingrae.com.au
Developer of Arnold - Gym & Martial Arts Database Management System
www.gymdatabase.com.au
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|