Hi,
I am deleting some files from a directory with C# and then I am getting the contained files so if I don't refresh the content of the directory the deleted file will be added as a contained file so how can I refresh the content of the directory using C# it's not the refresh() method in fileinfo I've tried it,
thanks.

VulpesRank #55 · 29.2K reputationPosted Sep 19, 2012, 12:32 PM EDT
abed akhi71 reputationPosted Sep 20, 2012, 1:07 AM EDT
Yeah I don't know why yesterday that did not work I think I was missing something I've added:
if (System.IO.File.Exists(imgpath))
{
System.IO.File.Delete(Session["imgpath"].ToString());
}
string path = Server.MapPath("~/Images/");
string[] files = System.IO.Directory.GetFiles(path);
DropDownList3.DataSource = files;
DropDownList3.DataBind();
in the deletion button and it worked, thanks.