Support Forums

Full Version: Generate Random Numbers & Letters [ Small Function ]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hi
This Morning i was Bored and i wanted to make a Random Numbers and Letters For FUN and Simplicity. Yes i Already Make Some others Functions Generate Random Numbers and Letters But there was all the Time Big ass Functions and Not Simple. Its Takes me around 20 MINs (Its not a lie Like some People doing all the Time)BTW There is it Enjoy Big Grin

FUNCTION:
Code:
'Note: The  Stuff = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" You Can put Whatever crap in it like Symbols or whatever you want.
Public Function Gennn(ByVal length As Integer)
        Dim charz() As Char = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
        Dim RAN As New Random
        Dim STR As String = Nothing
        For INT As Integer = 1 To length
            STR += charz.ElementAt(RAN.Next(charz.Length))

        Next
        TextBox3.Text = STR
        Return STR
    End Function
End Class

USE IT:
Code:
'Note: The "(16)" is the Length of the Generated Strings.
Gennn(16)
Bummp
Please Comments !!! Sad
Thanks for sharing. I'm sure some will find this useful. (For password generators etc...)

I'll add it to my compilation thread.
I didnt know this was so simple.. wtf?
Thanks for sharing this now I can have a bit of fun wittit'
You didn't code this.

-.-

this is a function I have been using since january 2009

D: anyway nice share.
Thank you for this tut, shall be usefull.
thank's..maybe i use your source in future to write my personal software! Big Grin
Thanks for sharing! Will be helpful for lots of users!
Thanks For Comments Big Grin
Hmm, Ill try this out in a bit

Thanks for the share man Smile
Pages: 1 2 3