Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[How to] Create random strings(upper,lower and integers)[Src]
#11
(05-12-2011, 11:16 AM)euverve Wrote: A slight change version, with number of random strings to generate.

Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If StrLength.TextLength <= 0 Then
            MsgBox("Input string length.")
        Else
            StrOutput.Text = RandomString(StrLength.Text)
        End If
    End Sub

    Function RandomString(ByVal val As Integer) As String
        RandomString = ""
        Const strUpper As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        Const strLower As String = "abcdefghijklmnopqrstuvwxyz"
        Const strNumbers As String = "1234567890"
        Dim strTotal As String = strUpper & strLower & strNumbers
        Dim i As Short

        For i = 1 To CInt(val)
            RandomString = RandomString & Mid(strTotal, Int((Rnd() * Len(strTotal)) + 1), 1)
        Next i
    End Function

Screenshot:
[Image: 3iTgN.png]
A good mod, you made the source more clear

Reply
#12
Nice job, I don't know what someone may need this for, but great job. At least it works.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [VB.NET] Animated Form Extend [SRC] Fragma 6 5,542 10-10-2013, 12:18 PM
Last Post: Saket
  [VB.Net][SRC] YouTube Bot HF~Legend 5 3,665 11-25-2012, 05:54 AM
Last Post: Ixam
  [VB.Net][SRC]ProgressBar Color HF~Legend 14 7,516 09-08-2012, 04:18 PM
Last Post: spesificrelax
  [VB.NET] Basic Reverse Connection RAT [SRC] hasam 1 3,048 02-01-2012, 03:10 PM
Last Post: AceInfinity
  VB.NET Computer Information [SRC] Fragma 35 17,103 01-07-2012, 03:56 PM
Last Post: Quantum

Forum Jump:


Users browsing this thread: 1 Guest(s)