本人初学vbs,结合工作需要,写下如下代码,还望老手不要见笑了:- set co=createobject("wscript.shell")
- dim choice,web,user,password
- choice=inputbox("请选择 1:办公自动化 2:CRM系统 3:ODS系统 4:省公司统计平台1 5:省公司统计平台2")
- choice=choice-1
- web=array("http://134.160.132.68","http://134.175.6.74/TCRM","http://134.175.7.37","http://134.160.100.55:9080","http://134.160.100.55:9080")
- user=array("ln","733ZZX7044","liaol","zz_xgs","zz_zhtj")
- password=array("ln6177772","100001","ods123","6177772","8232218")
- co.run web(choice),vbhide
- wscript.sleep 5000
- if choice=0 then
- co.sendkeys "{tab}"
- wscript.sleep 200
- co.sendkeys "{tab}"
- wscript.sleep 200
- end if
- co.sendkeys user(choice)
- wscript.sleep 500
- co.sendkeys "{tab}"
- wscript.sleep 200
- co.sendkeys password(choice)
- wscript.sleep 500
- co.sendkeys "{tab}"
- if choice=2 then
- wscript.sleep 200
- co.sendkeys "~"
- end if
复制代码 本人的工作网络,大家是登录不上去的。
[ 本帖最后由 batman 于 2009-3-30 13:36 编辑 ] |