Public Shared Function NewPassword() As String
Dim PasswordParent As String = "0123456789ABCDENGHJKLMNPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%&*"
Dim RetVal As String = ""
Dim Rnd As Random = New Random(System.DateTime.Now.Millisecond) '通过日期产生随机数
For i As Integer = 0 To 8
Dim iRandNum As Integer = Rnd.Next(PasswordParent.Length)
RetVal += PasswordParent(iRandNum) '每次生一个随机数加入数组
Next i
Return RetVal
End Function
原文链接:https://www.f2er.com/vb/262195.html