Temporary File

ost

Well-known member
Joined
Jan 27, 2004
Messages
72
Location
Vanlose, Denmark
Hello

I need to create a temporary internet file. To do this i use

Code:
System.IO.Path.GetTempFileName()

this method creates a tmp file and then return the path and filename in a string.

The problem is that it return the string like this:

C:\DOCUME~1\WORK\ASPNET\LOCALE~1\Temp\tmp222.tmp

but the real path is

C:\Documents and Settings\WORK\ASPNET\Locale Settings\Temp\tmp222

Any suggestions?
 
ost said:
Hello

I need to create a temporary internet file. To do this i use

Code:
System.IO.Path.GetTempFileName()

Any suggestions?
I cant believe there isnt a method off of Path to do this. . .

heres a pinvoke -


PHP:
static extern uint GetLongPathName(
 string lpszShortPath,
 [Out] System.Text.StringBuilder lpszLongPath,
 uint cchBuffer);

public string GetLongPathName(string shortname)
{
 System.Text.StringBuilder longname = new System.Text.StringBuilder(256);
 uint n = (uint)longname.Capacity;
 GetLongPathName(shortname, longname, n);
 return longname.ToString();
}
 
thanx.. that is just what the doctor ordered :D

However I cant get it up and running in VB.Net. I have run the C# though a translator but no luck..

Anyone who can translate?
 
Back
Top