this is my code:
private void Method1()
{
int i = 1;
foreach (string file in Directory.EnumerateFiles(ImagesPath))
{
if (Path.GetExtension(file).EndsWith(".png"))
{
string image = (Path.GetFullPath(file));
i += 1;
}
}
}
The imagesPath is a string that binds to a folder which contains images,
Image1.png,
Image2.png
.
.
.
.
Image10.png,
Image11.png
.
.
I want to iterate from Image1.png--->Image2.png, but the foreach
iterates Image1.png-->Image10.png-->Image11.png and so forth.
Is there any way to override this?