The RemoveTempFiles method can be used to remove temporary files (map images) in any directory.


Namespace: AspMap
Assembly: AspMapNET (in AspMapNET.dll)

Syntax

Visual Basic (Declaration)
Public Function RemoveTempFiles( _ 
   ByVal tempDir As String,  _ 
   ByVal time As Integer _ 
) As String
C#
public string RemoveTempFiles(
   string tempDir,
   int time
)
C++
public:
 String RemoveTempFiles(
   String tempDir,
   int time
) sealed 
J#
public string RemoveTempFiles(
   string tempDir,
   int time
)
JScript
public  function RemoveTempFiles(
   tempDir : String,
   time : int
) : String

Parameters

tempDir
A string expression that evaluates to a path to a directory in which temporary files are generated.
time
Amount of time in minutes.

Return Value

An empty string on success, an error message string if an error occurred.

Remarks

A temporary file (map image) may be generated every time a user hits a page that contains a map. These temporary files are stored in a directory. The RemoveTempFiles method allows to keep this directory clean. You can specify the directory (usually TEMP in which the temporary files are generated), and amount of time in minutes (e.g. 30 means files older than 30 minutes will be removed). IMPORTANT: For security reasons, the RemoveTempFiles method will remove only files with the 'TEMP_' prefix and '.PNG', '.GIF', '.BMP' or '.JPG' extensions.

See Also