Const ForAppending = 8 Const ForReading = 1 Const FileName = "iplog.txt" Set objFSO = CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.OpenTextFile(FileName, ForAppending, True) objTextFile.WriteLine "------------------利用ADSL拨号变ip刷投票-----------------" objTextFile.WriteLine " " & Now objTextFile.Close For i=1 To 300 '刷多少票 Do '----------------------------拨号--------------------------------- Set pp = WScript.CreateObject("WScript.Shell") pp.run "rasdial 外网 /DISCONNECT",0 wscript.sleep 2000 pp.run "rasdial 外网 LAN245561315 11811",0 Set pp = Nothing wscript.sleep 2000 '----------------------------读取IP------------------------------- strComputer = "." Set objWMIService = GetObject("winmgmts://" & strComputer & "/root/cimv2") Set IPConfigSet = objWMIService.ExecQuery("Select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE") For Each IPConfig in IPConfigSet If IPConfig.IPAddress(0)<>"169.254.1.232" Then 'adsl的本地连接 IPAddress = IPConfig.IPAddress(0) End If Next '----------------------------判断IP是否重复----------------------- Set objFSO = CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.OpenTextFile(FileName, ForReading) Do Until objTextFile.AtEndOfStream strIP = objTextFile.Readline arrIPList = Split(strIP , ",") If arrIPList(0) = IPAddress Then IsSame = True Exit Do Else IsSame = False End If Loop objTextFile.Close Loop while IsSame = True '----------------------------保存IP记录--------------------------- Set objFSO = CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.OpenTextFile(FileName, ForAppending, True) objTextFile.WriteLine IPAddress &","& Now objTextFile.Close '----------------------------打开浏览器开始刷--------------------- Set ie=WScript.CreateObject("InternetExplorer.Application") ie.visible=1 '1浏览器可见0不可见 ie.navigate "http://www.169ol.com/ " '解决网通重定向问题(网通这好烦哦) wscript.sleep 3000 '提交的修改过的表单,本地也行,需要把ie安全设置低点,不然每次都会提示的。 ie.navigate "http://www.link888.net/testspeed.html" wscript.sleep 10000 '----------------------------结束浏览器进程------------------------ strComputer = "." Set objWMIService = GetObject("winmgmts:"& "{impers}!//" & strComputer & "/root/cimv2") Set colProcessList = objWMIService.ExecQuery("Select * from Win32_Process Where Name = 'IEXPLORE.exe'") For Each objProcess in colProcessList objProcess.Terminate() Next Next