Support Forums
Generate Random Numbers & Letters [ Small Function ] - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19)
+---- Thread: Generate Random Numbers & Letters [ Small Function ] (/showthread.php?tid=8468)

Pages: 1 2 3


Generate Random Numbers & Letters [ Small Function ] - MYPE - 07-17-2010

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)



RE: Generate Random Numbers & Letters [ Small Function ] - MYPE - 07-17-2010

Bummp
Please Comments !!! Sad


RE: Generate Random Numbers & Letters [ Small Function ] - Fragma - 07-18-2010

Thanks for sharing. I'm sure some will find this useful. (For password generators etc...)

I'll add it to my compilation thread.


RE: Generate Random Numbers & Letters [ Small Function ] - `P R O D I G Y™ - 07-21-2010

I didnt know this was so simple.. wtf?
Thanks for sharing this now I can have a bit of fun wittit'


RE: Generate Random Numbers & Letters [ Small Function ] - wchar_t - 07-25-2010

You didn't code this.

-.-

this is a function I have been using since january 2009

D: anyway nice share.


RE: Generate Random Numbers & Letters [ Small Function ] - Matter - 07-27-2010

Thank you for this tut, shall be usefull.


RE: Generate Random Numbers & Letters [ Small Function ] - JesusOfSuburbia - 07-27-2010

thank's..maybe i use your source in future to write my personal software! Big Grin


RE: Generate Random Numbers & Letters [ Small Function ] - Wynston - 07-27-2010

Thanks for sharing! Will be helpful for lots of users!


RE: Generate Random Numbers & Letters [ Small Function ] - MYPE - 07-28-2010

Thanks For Comments Big Grin


RE: Generate Random Numbers & Letters [ Small Function ] - InSaNe iS BoSS - 07-28-2010

Hmm, Ill try this out in a bit

Thanks for the share man Smile