I have 5 images in a folder. The name of the images are:
img1.jpg
img2.jpg
img3.jpg
img4.jpg
img5.jpg
If I delete img3, I want the other images below 3 to move up and be renamed like:
img1.jpg
img2.jpg
img3.jpg
img4.jpg
I can delete specific image from the folder like this:
int i = 3;
string imgpath = @"C:\images" + "/" + "img" + i.ToString() + ".jpg";
File.Delete(imgpath );
But how do I rename the images below img3 ?