Hola
No se bien este tema, pero acá en ejemplo en vb y en c:
VB.NET:
Código PHP:
' Create an array of strings.
Dim names() As String = _
{"Hartono, Tommy", "Adams, Terry", "Andersen, Henriette Thaulow", "Hedlund, Magnus", "Ito, Shu"}
Dim random As Random = New Random(DateTime.Now.Millisecond)
' Get a string at a random index within the array.
Dim name As String = names.ElementAt(random.Next(0, names.Length))
' Display the output.
MsgBox("The name chosen at random is " & name)
' This code produces the following output:
'
' The name chosen at random is Ito, Shu
EL MISMO PERO EN CSHARP:
Código PHP:
tring[] names =
{ "Hartono, Tommy", "Adams, Terry", "Andersen, Henriette Thaulow",
"Hedlund, Magnus", "Ito, Shu" };
Random random = new Random(DateTime.Now.Millisecond);
string name = names.ElementAt(random.Next(0, names.Length));
Console.WriteLine("The name chosen at random is '{0}'.", name);
/*
This code produces the following sample output:
The name chosen at random is 'Ito, Shu'.
*/
Poder sobre este tema en la página siguiente:
http://msdn.microsoft.com/en-us/library/bb299233.aspx