浏览 2082 次
锁定老帖子 主题:用vbscript也可以刷网站
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2009-07-30
最后修改:2009-07-31
Set oNetwork = WScript.CreateObject("WScript.Network") computername=oNetwork.ComputerName '获取计算机名 strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set objShare = objWMIService.Get("Win32_Proxy.ServerName='computername'") Set objInParam = objShare.Methods_("SetProxySetting"). _ inParameters.SpawnInstance_() Const ForReading = 1 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile("C:\1.txt", ForReading) input=inputbox("请输入你要刷的网站名:" +chr(13)+ _ "例如:" +chr(13)+ _ "http://hi.baidu.com/icecoldheart","请输入地址") if input<>"" then Do Until objFile.AtEndOfStream strNextLine = objFile.ReadLine If Len(strNextLine) > 0 Then strLine = strNextLine address=instr(1,strline,":",1) ip=left(strline,address-1) port=right(strline,len(strline)-address) '这是读文本的代码一直读到文本的最后一行 ' 添加端口号和代理服务器地址 objInParam.Properties_.Item("ProxyPortNumber") = port objInParam.Properties_.Item("ProxyServer") = ip Set objOutParams = objWMIService.ExecMethod("Win32_Proxy.ServerName='computername'", "SetProxySetting", objInParam) set objshell=createobject("wscript.shell") set objie=createobject("internetexplorer.application") objie.visible=true objshell.appactivate "Windows Internet Explorer" wscript.sleep 3000 objshell.sendkeys "{tab}" objshell.sendkeys input '这的input一样赋值的时候不能加双引号 objshell.sendkeys "{enter}" wscript.sleep 6000 objie.quit End If Loop objFile.Close end if 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |