Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Session["Path"] = Server.MapPath("~/Documents/") + id + "_" + documentid + "_" + fileName;
FileInfo file = new FileInfo(Session["Path"].ToString());
if (file.Exists)
{
file.Delete();

}
Posted
Updated 12-Apr-13 19:17pm
v2
Comments
CHill60 12-Apr-13 6:37am    
What code are you using to try to delete the files?

1 solution

HI!!! try this code i think it should helps you

C#
string completePath = Server.MapPath("~/ItemsPics/" + item.Text);

               if (System.IO.File.Exists(completePath))
               {

                   System.IO.File.Delete(completePath);
                }


this code is basically write to delete image from folder so make correction on path and try
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900