Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Generate Random Numbers & Letters [ Small Function ]
#1
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)
[Image: mypegif2.gif]
Reply


Messages In This Thread
Generate Random Numbers & Letters [ Small Function ] - by MYPE - 07-17-2010, 06:11 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Function] Check For Prime - C# Source AceInfinity 0 954 03-31-2012, 07:00 AM
Last Post: AceInfinity
  Help with VB 2010 (Numbers) Dεlluzion 1 737 06-22-2011, 12:07 PM
Last Post: Coding Support
  Factor Finder v1.0 (Numbers) AceInfinity 15 3,751 06-21-2011, 06:27 PM
Last Post: RiChZ
  [VB.NET/Source] Converte Numbers To Letters : 1000 To One Thousand! ThePrinCe 7 1,550 06-18-2011, 04:09 PM
Last Post: Coding Support
  [How to] Create random strings(upper,lower and integers)[Src] Modestep 11 2,383 05-14-2011, 02:17 AM
Last Post: モrainee

Forum Jump:


Users browsing this thread: 2 Guest(s)