有没有办法使用 vb.net 生成一个唯一的随机 6 位数字?所以没有重复的随机数?
我尝试了以下代码,但它显示“Type Char 没有构造函数”
Dim chars As String = "0123456789"
Dim word As Char() = New Char(6)
Dim rnd As New Random()
For i As Integer = 0 To word.Length - 1
word(i) = chars.Chars(rnd.Next(chars.Length))
Next
TheTextBox.Text = New String(word)