Pues algo asi con substring y un rand
Código vb:
Ver originalPublic Function randText(lenght As Integer) As String
Dim r As New Random()
Dim str As String = ""
Dim rand As String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
For i As Integer = 0 To lenght - 1
str += rand.Substring(r.[Next](62), 1)
Next
Return str
End Function