怎么解决dictionary的此键已与该集合的一个元素关联
想成技术牛 2017-11-15 05:01:24 Public Function CheckFocuse(TestObject)
If TestObject.CheckProperty ("focused", "true", "1")Then
CheckFocuse = True
Else
CheckFocuse = Faluse
End If
End Function
Const VK_TAB = 15
Set DeviceReplay = CreateObject("Mercury.DeviceReplay")
Set dic = CreateObject("Scripting.Dictionary")
dic.Add, dialog("Login").WinEdit("Agent Name:")
dic.Add, dialog("Login").WinEdit("Password:")
dic.Add, dialog("Login").WinButton("OK")
Dialog("Login").Activate
CheckFocuse(dic.Item("0"))
For i = 2 to dic.Count
If CheckFocuse(dic.Item(Cstr(i))) = False Then
Exit For
Else
Msgbox "ok"
End If
Next
在运行到 dic.Add, dialog("Login").WinEdit("Password:")时出现此键已与该集合的一个元素关联,怎么修改程序啊?