←Select platform

DeleteTemporaryFile Method

Summary

Deletes the specified temporary file.

Syntax
C#
VB
C++
public static bool DeleteTemporaryFile( 
   string fileName 
) 
Public Shared Function DeleteTemporaryFile( 
   ByVal fileName As String 
) As Boolean 
public:  
   static bool DeleteTemporaryFile( 
      String^ fileName 
   ) 

Parameters

fileName

String containing the filename to delete.

Return Value

true, if the specified temporary file was deleted; otherwise, false.

Remarks

Use this method to delete temporary files created by RasterDefaults.GetTemporaryFileName.

✅ IMPORTANT

You must call this method to delete temporary files if RasterDefaults.TempFileMode is set to LeadTempFileMode.Memory to avoid memory leaks.

Example
C#
VB
using Leadtools; 
using Leadtools.Codecs; 
using LeadtoolsExamples.Common; 
 
public static void DeleteTemporaryFile_Example() 
{ 
   String tempFile = RasterDefaults.GetTemporaryFileName; 
 
   /* do something with the temp file */ 
 
   RasterDefaults.DeleteTemporaryFile(tempFile); /* Delete tempFile when you are done with it */ 
} 
Imports Leadtools 
Imports Leadtools.Codecs 
Imports Leadtools.ImageProcessing 
 
Public Shared Sub DeleteTemporaryFileTest() 
   Dim tempFile As String = RasterDefaults.GetTemporaryFileName 
 
   ' do something with the temp file  
 
   RasterDefaults.DeleteTemporaryFile(tempFile) ' Delete tempFile when you are done with it  
End Sub 

Requirements

Target Platforms

Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

Leadtools Assembly