![]() |
|
[.NET] How to: Generate random numbers! [Noob proof] - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] How to: Generate random numbers! [Noob proof] (/showthread.php?tid=262839) Pages: Pages
1
2
|
How to: Generate random numbers! [Noob proof] - Nezami - Feb 7, 2010 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: 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. * - Nezami - Feb 7, 2010 No comments? ): msgmsgmsgmsg * - collinetnick - Feb 7, 2010 Thank you, will use it to make a fake keygen and spread it 😉. * - Nezami - Feb 7, 2010 (Feb 7, 2010 10:24 AM)collinetnick Wrote: Thank you, will use it to make a fake keygen and spread it 😉. Woot first comment :P * - collinetnick - Feb 7, 2010 (Feb 7, 2010 10:25 AM)-X- Wrote: Woot first comment :P Can you just give me the whole source code instead of telling me to put code in between code? * - Nezami - Feb 7, 2010 (Feb 7, 2010 10:28 AM)collinetnick Wrote: Can you just give me the whole source code instead of telling me to put code in between code? Yes 1 Second Code Public Class Form1* - Kōtei - Feb 7, 2010 niiice. Now I can do keygens instead of fake hacks for games...Keygen so much more effective * - collinetnick - Feb 7, 2010 How can we change the code's to enable it to generate number's we listed. * - Sour Diesel - Feb 7, 2010 nice tut, noob friendly🤣 * - Leoopardss - Feb 7, 2010 can i use this Generate Random Number in my Crypter ? As the Infinity Crypter etc etc ? Can i use ? * - Nezami - Feb 7, 2010 (Feb 7, 2010 11:29 AM)Leoopardss Wrote: can i use this Generate Random Number in my Crypter ? If you mean "do i have permission to use" then yes. * - collinetnick - Feb 7, 2010 (Feb 7, 2010 11:32 AM)-X- Wrote: If you mean "do i have permission to use" then yes. I think he mean's, can it work. And if you edit the code to the amount of interval's as your crypter need's then yes. * - Nezami - Feb 7, 2010 (Feb 7, 2010 11:39 AM)collinetnick Wrote: I think he mean's, can it work. And if you edit the code to the amount of interval's as your crypter need's then yes. Oh okay :P Im still a noob at this stuff so I don't know what he means and stuff ;D * - llamafbi - Mar 5, 2010 Thanks It helped alot :D * - Nezami - Mar 5, 2010 (Feb 7, 2010 10:48 AM)collinetnick Wrote: How can we change the code's to enable it to generate number's we listed. http://www.youtube.com/user/TeachMeComputer#p/u/5/gSGUDpLWp-k |