string[] s = {"pic1", "pic2", "pic3","pic4", "pic5"}; ArrayList al = new ArrayList();System.Random rnd = new Random();int i = rnd.Next(5); int temp = 0; for (;i> 0;--i,temp = rnd.Next(5)) { if(!al.Contains(temp)) al.Add(temp); }foreach(int index in al) { Response.Write(s[index]); }
ArrayList al = new ArrayList();System.Random rnd = new Random();int i = rnd.Next(5);
int temp = 0;
for (;i> 0;--i,temp = rnd.Next(5))
{
if(!al.Contains(temp))
al.Add(temp);
}foreach(int index in al)
{
Response.Write(s[index]);
}