EN
C# / .NET - delete file
9
points
In this article, we would like to show how to delete file using C# / .NET.
Quick solution:
// using System.IO;
File.Delete(@"C:\path\to\file.txt");
Practical example
using System.IO;
public static class Program
{
public static void Main(string[] args)
{
string path = @"C:\path\to\file.txt";
File.Delete(path);
}
}
Example result: