Author: Admin 03/13/2023
Language:
C#
Views: 51
Tags: cs delete file
This is how to delete a file and check whether it exists.
This is very ease in C# using the File class.
Use System.IO
if(File.Exists(@"C:\MyFile.txt"))
{
File.Delete(@"C:\MyFile.txt");
}