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