میتونید نام فایلها رو در یک لیست قرار بدید و از اون استفاده کنید:
List<string> images;
private void button1_Click(object sender, EventArgs e)
{
string dir = Path.Combine(Application.StartupPath, "images");
images = Directory.GetFiles(dir).ToList();
timer1.Interval = 10000;
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
Random myRandom = new Random();
int index = myRandom.Next(0, images.Count);
try
{
pictureBox1.Image = Image.FromFile(images[index]);
}
catch (Exception)
{
images.RemoveAt(index);
}
}