Ok, there are a couple of problems here:
The second one is easy:
if (counter < images.Count - 1)
images
is an array of strings, so it doesn't have a Count property - it has a Length instead. The reason you get the error message you do is that all arrays implement
IEnumerable
, so the Linq extension method
Count<type of IEnumerable>()
is being assumed.
Change it to
images.Length
and it should be fine.
Your first I can't sort immediately - you don't tell us what the error is, and it could be
anything! :laugh:
"how can i use "rand" in that winform , what should be declare for this "rand " ????????"
Declare it at class level:
private Random rand = new Random();
You could declare it locally, but then it doesn't necessarily provide such random results. Using a single class level instance means that the sequence is normally more random than a local Random definition.