复制代码 代码如下:
::==========================================
:: IP.bat
:: v0.1
:: jinminghou.cn@2009-12-22
::==========================================
@echo off
title GetIP
set ip=unknown
echo On Error Resume Next:Set oDOM=WScript.GetObject("http://www.jinminghou.cn/"^&now()):Dim i:For i = 1 To 50:If
oDOM.ReadyState="complete" Then Exit For:End If:WScript.Sleep 200:Next:Dim Temp:Temp=oDOM.documentElement.outerText:Set oDOM=Nothing:Temp=Mid(Temp, Instr
(Temp, "[")+1, Instr(Temp, "]")-Instr(Temp, "[")-1):WScript.Echo Temp>"%temp%\GetIP.vbs"
for /f "tokens=1,* delims=:" %%i in ('"cscript //nologo ^"%temp%\GetIP.vbs^"') do set ip=%%i
if exist "%temp%\Getip.vbs" del "%temp%\Getip.vbs">2>nul
echo Your IP: [%ip%]
pause>2>nul
【方案一】BAT + VBS
复制代码 代码如下:
@echo off
set "URL=http://www.ip138.com/ip2city.asp"
>%temp%/download.vbs echo Set objDOM = WScript.GetObject(WScript.Arguments(0))
%temp%/download.vbs echo Do Until objDOM.ReadyState = "complete"
%temp%/download.vbs echo WScript.Sleep 100
%temp%/download.vbs echo Loop
%temp%/download.vbs echo WScript.Echo objDOM.DocumentElement.OuterText
for /f "tokens=2 delims=[]" %%a in ('cscript //nologo //e:vbscript %temp%/download.vbs "%URL%"') do (
set "PublicIP=%%a"
)
echo,%PublicIP%
pause
【方案二】BAT + wget.exe(GNU)
复制代码 代码如下:
@echo off
set "URL=http://www.ip138.com/ip2city.asp"
for /f "tokens=2 delims=[]" %%a in ('wget -q "%URL%" -O -') do (
set "PublicIP=%%a"
)
echo,%PublicIP%
pause
【方案三】BAT + curl.exe(GNU)
复制代码 代码如下:
@echo off
set "URL=http://www.ip138.com/ip2city.asp"
for /f "tokens=2 delims=[]" %%a in ('curl -s "%URL%"') do (
set "PublicIP=%%a"
)
echo,%PublicIP%
pause
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
更新日志
- 老虎鱼AnneClarkwithUllavanDaelenJustinCiuche-Borderland-HiRes-Files24bit88.2kHz
- 江玲2004-百合盛开2CD[歌林][WAV+CUE]
- 孙露《怕什么孤单3CD》深圳音像[WAV分轨]
- s14全球总决赛目前是什么结果 s14全球总决赛赛程结果图一览
- s2TPA夺冠五人名单都有谁 tpa战队s2夺冠队员名单一览
- s13wbg战队成员都有谁 wbg战队s13成员名单一览
- 网友热议《幻兽帕鲁》停售、赔千万日元:那也赚麻了 不亏
- 这谁顶得住 《最终幻想7:重生》尤菲3D作品穿上终极芙蕾娜衣服
- 外媒称PS5pro违背承诺:《蜘蛛侠2》根本没法4K60帧
- 群星.2007-中文十大金曲30周年纪念专辑【RTHK】【WAV+CUE】
- 杨林.1989-留一点爱来爱自己【综一唱片】【WAV+CUE】
- 南合文斗.2007-陪君醉笑三千尘鸟人唱片】【FLAC+CUE】
- 群星《我们的歌第六季 第1期》[320K/MP3][90.72MB]
- 群星《我们的歌第六季 第1期》[FLAC/分轨][456.01MB]
- 李雨寰《Break Free》[320K/MP3][98.39MB]