VB 2010 Generate Random Strings and Random Numbers
Generate Random Strings and Random Numbers
![]() |
VB 2010 Generate Random Numbers and Strings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
♥ Here are some online Visual Basic lessons and courses :
- Visual Basic .Net Online Course Intro
- Visual Basic .Net For MS-Access with ADO.Net Course
- Visual Basic .Net snippets collection
- Visual Basic .Net - How to check for the internet connection
- Visual Basic .Net - POP3 and Receiving/Reading E-mails
- Visual Basic .Net - Generate Random Combinations
- Visual Basic .Net - Play sounds on Button Click or Mouse Hover
- Visual Basic .Net - Progress Bar control
- Visual Basic .Net Solution - The application failed to initialize
- Visual Basic .Net - Working with Database full example
- Visual Basic .Net - There is already an open DataReader associated
- Visual Basic .Net - Free POS System Project Source Code