var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
var random = new Random();
var result = new string(
Enumerable.Repeat(chars, 10)
.Select(s => s[random.Next(s.Length)])
.ToArray());
Public Shared Function RandomAlphaNumber(Optional ByVal Qty As Integer = 10, Optional ByVal chars As String = "abcdefghijklmnopqrstuvwxyz0123456789") As String
If (Qty = Nothing OrElse chars = Nothing OrElse chars.Length = 0 OrElse Qty < 1) Then
'write log.
Return "Error Random String"
End If
Dim rnd = New Random()
Return New String(Enumerable.Repeat(chars, Qty).Select(Function(s) s(rnd.Next(s.Length))).ToArray())
End Function