Use Name Space : using System.IO;
C# code
----------------
string filePhisicalPath = Server.MapPath("~/Images/MyFileName.pdf");
FileInfo objFile = new FileInfo(filePhisicalPath);
if (objFile.Exists)
{
objFile.Delete();
}
C# code
----------------
string filePhisicalPath = Server.MapPath("~/Images/MyFileName.pdf");
FileInfo objFile = new FileInfo(filePhisicalPath);
if (objFile.Exists)
{
objFile.Delete();
}