论坛首页 入门技术论坛

用vbscript也可以刷网站

浏览 2082 次
精华帖 (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

 
1.txt中的内容是一些代理服务器的地址

论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics