用vbscript也可以刷网站

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中的内容是一些代理服务器的地址

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值