How to generate cryptographically random numbers?

How do i generate random numbers in visual basic?

  • ok so i took a vb class and they gave an example. They somehow declared (something) as new random and then like i could put into my code: "(integer) = (something).next(#, #)" and it would generate a random number between # and #. right now my sintax is not correct because i have: "Dim find as new random" and then "book = find.next(1, 67)" and while i should get a random number >= 1 and < 67 for whatever reason i am not getting any number whatsoever. If someone could help me use the predefined random function in visual studio 2008 express edition that would be really helpful. thanks!

  • Answer:

    Try putting the starting and ending random number in seperate ();

Jake at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

Try Dim Rand As Integer Rand = Int((High - Low + 1) * Rnd) + Low (Where High and Low are your limits)

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.