VB 2010 Generate Random Strings and Random Numbers

Generate Random Strings and Random Numbers

VB 2010 Generate Random Numbers and Strings
VB 2010 Generate Random Numbers and Strings


Using this function will generate Random Strings ......

Function RandomString(cb As Integer) As String
Randomize
Dim rgch As String
rgch = "abcdefghijklmnopqrstuvwxyz"
rgch = rgch & UCase(rgch) & "0123456789"
Dim i As Long
For i = 1 To cb
RandomString = RandomString & Mid$(rgch, Int(Rnd() * Len(rgch) + 1), 1)
Next
End Function
view raw gistfile1.vb hosted with ❤ by GitHub
Using this function will generate Random Numbers ......
Private Function RandomDoubles(cb As Integer) As Double
Randomize
Dim rgch As Double
rgch = "123456789101112"
rgch = rgch & Round(rgch) & "1211109876543210"
Dim i As Long
For i = 1 To cb
RandomDoubles = RandomDoubles & Mid$(rgch, Int(Rnd() * Len(rgch) + 1), 1)
Next
End Function
view raw gistfile1.vb hosted with ❤ by GitHub

Here are some online Visual Basic lessons and courses :

Popular posts from this blog

VB .NET DropBox Api Source Code Example

VB .NET Google Drive Api Source Code Example

VB.NET Access 2007 Hierarchical TreeView

VB.NET How to properly close a windows application Form

DAO in VB .NET MS ACCESS Database

Solution - There is already an open DataReader associated with this Command which must be closed first.