Hey everything I am going to show you how to generate a random number between 2 numbers chosen by you., but please remember the max you can go up to is.
1 and 2,147,483,647.
First of your going to want to create a button and a text box, name the button whatever you want, I am going to go with "Generate"
It should look like this:
[IMG]http://i45.[censored].com/6xulgh.jpg[/IMG]
Now double click the button or right click and select "view code".
Now, between these 2 texts:
You put this:
This is basically declaring r as an integer and making it so you can use r which will generate a random number. But first, you need to say between what numbers you want E.G 1-100, 10-500, 11-12
So between these:
put:
This is saying that your integer equals a random number between 1 and 10, if you want to change the number simply change "(1, 10)" to whatever you want.
That's all good but now the final step is to make it so the random number will appear somewhere, atm it generates a random number but doesn't show it, so in between:
and
Put this bit of code:
This will make the generated number appear in text box 1.
Now to make it a bit more advanced you could copy the first bit where you "dim r as integer" and "dim objrandom as new..." but this time change these:
"r" and "objrandom" so now you can have
Or whatever you want, after you have done this put the other bit of code as well
And change "r" and "objrandom" to whatever you delcared (dim) earlier on.
This will enable you to put this instead
This code will make the integer "t" appear which in my case was a random number between 10 and 99 and then the letter "x" appear and then the integer "r" appear which in my case was a random number between 100 and 1000.
Getting something like this: "54x753"
This project may help in fake programs such as keygens/auth gens etc. So hope you enjoyed my tutorial and hopefully you learned something thanks.
1 and 2,147,483,647.
First of your going to want to create a button and a text box, name the button whatever you want, I am going to go with "Generate"
It should look like this:
[IMG]http://i45.[censored].com/6xulgh.jpg[/IMG]
Now double click the button or right click and select "view code".
Now, between these 2 texts:
Code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickCode
End SubYou put this:
Code
Dim r As IntegerCode
Dim objRandom As New System.Random(CType(System.DateTime.Now.Ticks Mod System.Int32.MaxValue, Integer))This is basically declaring r as an integer and making it so you can use r which will generate a random number. But first, you need to say between what numbers you want E.G 1-100, 10-500, 11-12
So between these:
Code
Dim objRandom As New System.Random(CType(System.DateTime.Now.Ticks Mod System.Int32.MaxValue, Integer))Code
end subput:
Code
r = objRandom.Next(1, 10)That's all good but now the final step is to make it so the random number will appear somewhere, atm it generates a random number but doesn't show it, so in between:
Code
r = objRandom.Next(1, 10)Code
end subPut this bit of code:
Code
TextBox1.Text = rNow to make it a bit more advanced you could copy the first bit where you "dim r as integer" and "dim objrandom as new..." but this time change these:
"r" and "objrandom" so now you can have
Code
Dim t As IntegerCode
Dim Randoml As New System.Random(CType(System.DateTime.Now.Ticks Mod System.Int32.MaxValue, Integer))Or whatever you want, after you have done this put the other bit of code as well
Code
r = objRandom.Next(1, 10)This will enable you to put this instead
Code
TextBox1.Text = t & "x" & r 'Displays the number in a text boxThis code will make the integer "t" appear which in my case was a random number between 10 and 99 and then the letter "x" appear and then the integer "r" appear which in my case was a random number between 100 and 1000.
Getting something like this: "54x753"
This project may help in fake programs such as keygens/auth gens etc. So hope you enjoyed my tutorial and hopefully you learned something thanks.

