Ver Mensaje Individual
  #2 (permalink)  
Antiguo 25/04/2010, 09:40
Trulala de cordoba
 
Fecha de Ingreso: octubre-2000
Mensajes: 1.692
Antigüedad: 24 años, 3 meses
Puntos: 19
Respuesta: elementat y c#

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(0names.Length))

        
' Display the output.
        MsgBox("The name chosen at random is " & name)

        ' 
This code produces the following output:
        
'
        ' 
The name chosen at random is ItoShu 

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(0names.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
__________________
PD: Con amor, fe, amor a Dios y amistad podemos hacer un mundo mejor!!!!