C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Caution: There are limitations to this approach. Longer strings are not available, and no uppercase letters are included.
And: With the Random class, we could generate letters and numbers and add them to a Char array.
Char ArrayVB.NET program that generates random Strings
Imports System.IO
Module Module1
Public Function GetRandomString()
Dim p As String = Path.GetRandomFileName()
p = p.Replace(".", "")
Return p
End Function
Sub Main()
' Get two random strings.
Dim value As String = GetRandomString()
Dim value2 As String = GetRandomString()
' Display the strings.
Console.WriteLine(value)
Console.WriteLine(value2)
End Sub
End Module
Output
qkdqh2lmcev
tsx1vo4fdhh