Tuesday, May 5, 2015

how to delete physical file form folder (sollution explorer) by using asp.net with C#

if (System.IO.File.Exists(HttpContext.Current.Server.MapPath("Images/filename.jpg")))
{
            System.IO.File.Delete(HttpContext.Current.Server.MapPath("Images/filename.jpg"));
            Response.Write("file deleted");
}

No comments:

Post a Comment