METHOD:  FileSystemObject.GetTempName

Implemented in version 2.0
 
object.GetTempName

This method is used to generate a random filename to use for a temporary file. It does not create a temporary file, but is used in conjunction with the CreateTextFile method when a temporary file is required.
 
Code:
<%
Dim filesys, tempname, tempfolder, tempfile
Set filesys = CreateObject("Scripting.FileSystemObject")
Set tempfolder = filesys.GetSpecialFolder(2)
tempname = filesys.GetTempName
Set tempfile = tempfolder.CreateTextFile(tempname)
Response.Write ("The temporary file, '" & tempfile & "', has been created")
%>


Output:
"The temporary file, 'rad80F30.tmp', has been created."


Copyright 1999-2004 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information