How can i delete an image in a folder
ASP.NET
4
Posts
4
Posters
0
Views
1
Watching
-
I am using vb with asp.Net.i want to delete picture in my folder using code.How can i do this
-
I am using vb with asp.Net.i want to delete picture in my folder using code.How can i do this
-
I am using vb with asp.Net.i want to delete picture in my folder using code.How can i do this
Hi,
string imgFolder = Server.MapPath("folderPath"); string[] imgList = Directory.GetFiles(imgFolder, "*.jpg"); foreach (string img in imgList) { FileInfo imgInfo = new FileInfo(img); if (imgInfo.LastWriteTime < DateTime.Now.AddMinutes(-3)) { imgInfo.Delete(); } }
Thanks, Sun Rays To get something you must have to try once. My Articles
-
I am using vb with asp.Net.i want to delete picture in my folder using code.How can i do this