Delete File - CSharp File IO

CSharp examples for File IO:File Command

Description

Delete File

Demo Code


using System.IO ;
using System.Windows.Forms ;
using System;/* w  w w  . j  av  a  2s .  c o m*/

public class Main{

      public static void DeleteFile(string filePath)
      {
            if (File.Exists(filePath))
         {
                File.Delete(filePath);               
         }
      }
}

Related Tutorials