Delete a file in CSharp
Description
The following code shows how to delete a file.
Example
//from ww w. ja va 2s . c o m
using System;
using System.IO;
public class MainClass
{
static void Main(string[] args)
{
FileInfo MyFile = new FileInfo(@"c:\Projects\Testing.txt");
MyFile.Create();
MyFile.Delete();
}
}