2014-10-30 74 views
0

需要關於如何在一個網頁中使用vbs創建多個機器人登錄的幫助。如何使用VBS在一個頁面中創建多個機器人登錄

對於單機器人登錄以下是我曾嘗試過 - 有人可以編輯這個創建多個?

在此先感謝!

Set a = createobject ("wscript.shell") 
a.run "http://yahoo.com" 
wscript.sleep (5000) 
a.sendkeys ("username") 
a.sendkeys chr (9) 
wscript.sleep (2000) 
a.sendkeys ("password") 
a.sendkeys "{Enter}" 
call msgbox ("Finished") 
wscript.quit 

=此僅發射1個登錄:(

+0

它滿足了'usernamepassword'到雅虎搜索中... – JosefZ 2014-10-31 17:30:46

回答

0

可以使用for循環多個登錄和使用數組值輸入用戶名和PWD。

Dim uname(5) 'assign user name value to array element 0 to 5 
Dim pwd(5) 'assign password value to array element 0 to 5 

Set a = createobject ("wscript.shell") 
For i=0 to 5 step 1 
a.run "http://yahoo.com" 
wscript.sleep (5000) 
a.sendkeys uname(i) 
a.sendkeys chr (9) 
wscript.sleep (2000) 
a.sendkeys pwd(i) 
a.sendkeys "{Enter}" 
call msgbox ("Finished") 
Next 
wscript.quit 
+0

怎麼樣在多個URL,例如[yahoo.com,gmail.com,facebook.com,等等...]??? – 2014-11-01 21:36:46

0

然後使用一個以上的陣列像

Dim ArrUrl(5) 
and assign value like 
ArrUrl(0) = "www.yahoo.com" 
ArrUrl(1) = "www.gmail.com" 
ArrUrl(2) "www.facebook.com" 

....

網址

,然後用它來代替循環靜態值

a.run ArrUrl(i) 
相關問題