- 积分
- 97
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-11-2
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
忙碌了两天,终于新鲜出炉了,可以实现自动读取外网ip,并自动发送到指定邮箱的小脚本,只有2kb!! 转载自怀化气象论坛
- dim wshshell
- set wshshell=wscript.createobject("wscript.shell")
- wshshell.run "iexplore.exe http://www.ip.cn/"
- wscript.sleep 10000
- WSHSHELL.SENDKEYS "%f"
- wscript.sleep 1000
- WSHSHELL.SENDKEYS "^a"
- wscript.sleep 2000
- wsHSHELL.SENDKEYS "^+"
- wscript.sleep 1000
- wsHSHELL.SENDKEYS "%i"
- wscript.sleep 500
- wsHSHELL.SENDKEYS "{DOWN}"
- wscript.sleep 500
- wsHSHELL.SENDKEYS "{ENTER}"
- wscript.sleep 500
- wsHSHELL.SENDKEYS "+"
- wscript.sleep 1000
- wsHSHELL.SENDKEYS "w"
- wscript.sleep 1000
- wsHSHELL.SENDKEYS "{DOWN}"
- wscript.sleep 1000
- wsHSHELL.SENDKEYS "{ENTER}"
- wscript.sleep 1000
- wsHSHELL.SENDKEYS "%n"
- wscript.sleep 500
- wsHSHELL.SENDKEYS "ip"
- wscript.sleep 500
- wsHSHELL.SENDKEYS "{TAB}"
- wscript.sleep 300
- wsHSHELL.SENDKEYS "{DOWN}"
- wscript.sleep 300
- wsHSHELL.SENDKEYS "{DOWN}"
- wscript.sleep 300
- wsHSHELL.SENDKEYS "{DOWN}"
- wscript.sleep 300
- wsHSHELL.SENDKEYS "{DOWN}"
- wscript.sleep 500
- wsHSHELL.SENDKEYS "{ENTER}"
- wscript.sleep 500
- wsHSHELL.SENDKEYS "{ENTER}"
- wscript.sleep 500
- wsHSHELL.SENDKEYS "{TAB}"
- wscript.sleep 500
- wsHSHELL.SENDKEYS "{ENTER}"
- wscript.sleep 1000
- wsHSHELL.SENDKEYS "%{F4}"
- set wshshell=nothing
- dim line
- Set fso = CreateObject("Scripting.FileSystemObject")
- Set f=fso.OpenTextFile("c:\ip.txt",1,False,-2)
- Do While f.AtEndOfStream<>true
- line=f.ReadLine
- If InStr(line, "IP")>0 Then
- zf = line
- End If
- loop
- f.close
- i = instr(zf, ":")'获取外网ip
- wip= Mid(zf, i + 12,14)
- '开始传送
- NameSpace = "http://schemas.microsoft.com/cdo/configuration/"
- Set Email = CreateObject("CDO.Message")
- Email.From = "*****@163.com" ’请实用实际邮箱地址代替
- Email.To = "*****@163.com" ’请实用实际邮箱地址代替
- Email.Subject = "站上de" & " " & date() & " " & time()
- Email.Textbody = wip
- With Email.Configuration.Fields
- .Item(NameSpace&"sendusing") = 2
- .Item(NameSpace&"smtpserver") = "smtp.163.com"
- .Item(NameSpace&"smtpserverport") = 25
- .Item(NameSpace&"smtpauthenticate") = 1 '验证类型
- .Item(NameSpace&"sendusername") = "*******" ‘请实用实际用户名代替
- .Item(NameSpace&"sendpassword") = "********" ‘请实用实际密码代替
- .Update
- End With
- Email.Send
复制代码
| |
|
评分
-
查看全部评分
|