Sin Jeong-hun
October 6th, 2002, 10:13 PM
How can I get "Temp" folder path with C#.
I've looked up System.Environment.SpecialFolder,
but "Temp" wasn't there.
In win 9X the temp path is typically
"C:\Windows\Temp"
In windows 2000,XP
"C:\\Windows\User Name\Local Settings\Temp
My current dirty solution is,
string tempinternet=System.Environment.GetFolderPath(
System.Environment.SpecialFolder.InternetCache);
string temppath=tempinternet.Substring(0,tempinternet.LastIndexOf("\\"))
+"\\temp";
But is this safe?
I've looked up System.Environment.SpecialFolder,
but "Temp" wasn't there.
In win 9X the temp path is typically
"C:\Windows\Temp"
In windows 2000,XP
"C:\\Windows\User Name\Local Settings\Temp
My current dirty solution is,
string tempinternet=System.Environment.GetFolderPath(
System.Environment.SpecialFolder.InternetCache);
string temppath=tempinternet.Substring(0,tempinternet.LastIndexOf("\\"))
+"\\temp";
But is this safe?