best way to check if file exist and delete it C# code example
Example: c# delete file if exists
if(File.Exists(@"C:\test.txt"))
{
File.Delete(@"C:\test.txt");
}
if(File.Exists(@"C:\test.txt"))
{
File.Delete(@"C:\test.txt");
}