2014-04-09 30 views
0

如何刪除由TempFileCollection在C#中創建的.tmp文件?如何刪除C#中由TempFileCollection創建的.tmp文件?

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

的問題是,當我決定把臨時文件,也不僅是一個.xml 文件,但只有我沒有創建.tmp文件。如何刪除.tmp文件 ,並在我決定保留臨時文件時保留我的.xml文件?

+0

要刪除臨時文件編程? – HackerMan

+0

@HackerMan當然是的。我不知道它爲什麼會自動創建。 – user3111311

回答

1

它添加到using指令using System.IO;

File.Delete("File path"); 

試試這個代碼...

相關問題