这是我的代码
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "john@text"
我想要的是,每次运行vbs文件时,“和@之间的文本都应该是随机的。john @ text每次都应该是随机的,例如sdfr @ text,aqwe @ text等。
答案 0 :(得分:-2)
使用随机生成的整数表示ASCII字符,然后将字节数组转换为字符串。示例:
Dim randomWord As String
Dim randomWordAsByteArray(1 To 4) As Byte
Randomize
Dim charNumber As Integer
For charNumber = 1 To 4
randomWordAsByteArray(charNumber) = Int((26 * Rnd) + 1) + 96
Next
randomWord = StrConv(randomWordAsByteArray, vbUnicode)