locked
Randomize Timer?

    Question

  • Hi all :) I'm using vb10.

     

    In vb6 you used timer for the randomize seed.

    I noticed vb10 no longer uses it. Does this mean by

    default it uses the system timer for the seed?

    Wednesday, October 27, 2010 6:49 PM

Answers

  • The Random class provides a constructor that does not include a seed value.  In that case, the random class instance is initialised using the time.

    http://msdn.microsoft.com/en-us/library/system.random.aspx

    "Random() Initializes a new instance of the Random class, using a time-dependent default seed value"

    • Marked as answer by Lord Odyssey Saturday, October 30, 2010 8:20 PM
    Wednesday, October 27, 2010 8:06 PM
  • I figured out what I was doing wrong. Thanks for the reply. :)
    • Marked as answer by Lord Odyssey Saturday, October 30, 2010 8:20 PM
    Saturday, October 30, 2010 8:20 PM

All replies

  • The Random class provides a constructor that does not include a seed value.  In that case, the random class instance is initialised using the time.

    http://msdn.microsoft.com/en-us/library/system.random.aspx

    "Random() Initializes a new instance of the Random class, using a time-dependent default seed value"

    • Marked as answer by Lord Odyssey Saturday, October 30, 2010 8:20 PM
    Wednesday, October 27, 2010 8:06 PM
  • I figured out what I was doing wrong. Thanks for the reply. :)
    • Marked as answer by Lord Odyssey Saturday, October 30, 2010 8:20 PM
    Saturday, October 30, 2010 8:20 PM