user3111311
user3111311

Reputation: 8001

How to remove the .tmp file created by TempFileCollection in C#?

How to remove the .tmp file created by TempFileCollection in C#?

TempInputCollection = new TempFileCollection("TempDirectoryPathHere", true);
string TempFile = TempInputCollection.AddExtension("xml");

The problem is, when I decide to keep the temporary files, there is not only an .xml file, but only a .tmp file which I did not create. How do I get rid of that .tmp file and just keep my .xml file when I decide to keep temporary files as here?

Upvotes: 0

Views: 391

Answers (1)

HackerMan
HackerMan

Reputation: 914

add this to using directives using System.IO;

 File.Delete("File path");

try this code...

Upvotes: 1

Related Questions