I want to be able to randomize the SendKeys command, so what do I to to
To make it send those in random order?Code:SendKeys.Send("1")
SendKeys.Send("2")
SendKeys.Send("3")
SendKeys.Send("4")
SendKeys.Send("5")
Printable View
I want to be able to randomize the SendKeys command, so what do I to to
To make it send those in random order?Code:SendKeys.Send("1")
SendKeys.Send("2")
SendKeys.Send("3")
SendKeys.Send("4")
SendKeys.Send("5")
try this:
vb Code:
Dim randomNumber As New Random Dim usedNumbers As New List(Of Integer) For x As Integer = 1 To 5 Dim number As Integer = randomNumber.Next(1, 6) If Not usedNumbers.Contains(number) Then usedNumbers.Add(number) SendKeys.Send(number.ToString) Else x -= 1 End If Next
You might like to check this out.