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.
VulpesPosted Sep 19, 2012, 4:32 PM
abed akhiPosted Sep 20, 2012, 5:07 AM
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.