UserVar mmhit=2000 信息点击总次数 UserVar settime=6:30:00 运行时间 //一个页面有用链接数是40个 dim links(40) Gosub 定时器 EndScript Sub 定时器 startRun=1 VBSCall MessageBox("脚本已开始运行!") runTime=CDate(settime) While startRun=1 If Abs(DateDiff("s",Time,runTime)) < 100 //取得桌面路径 Set objShell = CreateObject("WScript.Shell") x = objShell.SpecialFolders.Item("desktop") Set objShell = Nothing //打开日志文件,准备写入 set fso=CreateObject("Scripting.FileSystemObject") set myfile=fso.OpenTextFile(x&"\点击操作日志.log", 8, True) //创建浏览器对象 set ie=createobject("internetexplorer.application") Gosub 打开***网站 Textstr = Date & " " & Time & " 成功打开***网站!" myfile.writeline(Textstr) xxhit=0 Gosub 点击*****信息 Textstr = Date & " " & Time & " *****信息点击完成,共点击" & xxhit & "次。" myfile.writeline(Textstr) //关闭浏览器,清除对象 ie.quit Set ie = Nothing Textstr = Date & " " & Time & " 成功关闭***网站!" myfile.writeline(Textstr & vbCrLf) //关闭日志文件,清除对象 myfile.Close Set myfile = Nothing Set fso = Nothing EndIf //按小键盘+号终止运行 GetLastKey K If K=107 startRun=0 EndIf Delay 50000 EndWhile VBSCall MessageBox("脚本已停止运行!") Return 定时器 Sub 打开***网站 //打开***网站首页 url=www.****.cn ie.visible=1 ie.navigate url Gosub 延时 //激活窗口并最大化 wclass = "IEFrame" title = "*** - www.****.cn - Microsoft Internet Explorer" Plugin hwn=Window.Find(wclass , title) Plugin Window.Active(hwn) Plugin Window.Max(hwn) //填写用户名和密码 ie.Document.Form1.TextBox1.value = "********" Delay 200 ie.Document.Form1.TextBox2.value = "********" Delay 200 KeyPress 13,1 Gosub 延时 Return 打开***网站 Sub 点击****信息 xq=int(Timer) mod 5 For int(mmhit/20+0.5) //选择信息页面 If xq<5 xq=xq+1 Else xq=1 EndIf If xq=1 xian="*****1" ElseIf xq=2 xian="*****2" ElseIf xq=3 xian="*****3" ElseIf xq=4 xian="*****4" ElseIf xq=5 xian="*****5" Else xian="allxian" EndIf Gosub 打开某页面****信息 keywood="bid" : hit=20 Gosub 过滤信息并打开 EndFor Return 点击****信息 //打开某页面****信息(输入参数:xian) Sub 打开某页面****信息 url="www.****.cn/store/*****.aspx" aid=xian url=url & "?aid=" & aid ie.navigate url