hi,

i want to make an application which loads random picture from a folder containing 59 pictures.
How can i do it ?

Thanks in advance.

My primary concern would be what kind of pictures are you trying to display? A picture box control may not support them, in which case you need to find an alternative.

As far as picking a random picture, that borders on trivial:

var files = Directory.GetFiles(path, searchPattern);
var imagePath = files[new Random().Next(0, files.Length)];
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.