Arrays are zero indexed in C#, which means the first item in the array starts from zero.
So...
strArray[0] == "a"
strArray[1] == "b"
... and so on ...
So when you start from 1, you're skipping the first iamge. Then when you access the max value, you're out of bounds.
You need to access from 0 to max value - 1.
Hope that helps.
So...
Code:
string[] strArray = new string[] { "a", "b", "c", "d" };
strArray[1] == "b"
... and so on ...
So when you start from 1, you're skipping the first iamge. Then when you access the max value, you're out of bounds.
You need to access from 0 to max value - 1.
Hope that helps.
Comment