這篇文章主要介紹了如何使用vbs實現(xiàn)初始化隨機數(shù)生成器,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
代碼如下:
Dim MyValue, Response,data,thisd
data="30007|22899|22934"
thisd=Split(data, "|", -1, 1)
Randomize '初始化隨機數(shù)生成器。
Do Until Response = vbyes
MyValue = Int((3* Rnd) + 1)' 產(chǎn)生 1 到 3 之間的隨機數(shù)。
result=""&thisd(MyValue-1)
If result="妖" Then result="人妖"
Set objExplorer = WScript.CreateObject("InternetExplorer.Application")
objExplorer.Navigate "about:blank"
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Visible = 1
objExplorer.height=300
objExplorer.width=400
objExplorer.left=400
objExplorer.resizable=0
objExplorer.Document.Body.InnerHTML ="你上輩子是"&result
Response = MsgBox ("確認? ", vbYesNo)
Loop
感謝你能夠認真閱讀完這篇文章,希望小編分享的“如何使用vbs實現(xiàn)初始化隨機數(shù)生成器”這篇文章對大家有幫助,同時也希望大家多多支持創(chuàng)新互聯(lián)網(wǎng)站建設公司,,關注創(chuàng)新互聯(lián)行業(yè)資訊頻道,更多相關知識等著你來學習!