标题: [代码合集] [已解决]批处理怎样获取外网IP地址? [打印本页]
作者: zinet 时间: 2008-12-22 12:03 标题: [已解决]批处理怎样获取外网IP地址?
本帖最后由 pcl_test 于 2016-6-13 22:36 编辑
本人在网上收集了一个获取外网ip的批处理如下:- @echo off
- <"%~f0" more +5 >tmp.vbs
- cscript //NoLogo /e:vbscript tmp.vbs %1>my.txt
- echo >nul && del tmp.vbs
- goto:eof
- set oDOM = WScript.GetObject("http://www.ip138.com/ip2city.asp")
- do until oDOM.readyState = "complete"
- WScript.sleep 200
- Loop
- s=oDOM.documentElement.innerText
- set re = New RegExp
- re.Pattern="(\d+)\.(\d+)\.(\d+)\.(\d+)"
- For Each m in re.Execute(s)
- WScript.Echo m
- Next
复制代码
运行后会生成一个my.txt文档 格式是xxxx.xxxx.xxxx.xxxx
我想让它生成后的内容格式是 http://xxxx.xxxx.xxxx.xxxx:80
请问该批处理怎样修改,,,,,谢谢
还有能否把生成后的my.txt,自动上传到(FTP:abcd.com 账号:aaaa 密码:123 ) 的my的根目录下
望高人指点 谢谢
作者: Batcher 时间: 2008-12-22 12:28
@echo off
<"%~f0" more +5 >tmp.vbs
cscript //NoLogo /e:vbscript tmp.vbs %1>my.txt
echo >nul && del tmp.vbs
goto:eof
set oDOM = WScript.GetObject("http://www.ip138.com/ip2city.asp")
do until oDOM.readyState = "complete"
WScript.sleep 200
Loop
s=oDOM.documentElement.innerText
set re = New RegExp
re.Pattern="(\d+)\.(\d+)\.(\d+)\.(\d+)"
For Each m in re.Execute(s)
WScript.Echo m & ":80"
Next
关于自动FTP,请在本版搜索。
作者: canyuexiaolang 时间: 2010-4-24 13:47
自动FTP啊..- echo open abcd.com>1.txt
- echo aaaa>>1.txt
- echo 123>>1.txt
- echo bin>>1.txt
- echo put c:\my.txt>>1.txt
- echo bye>>1.txt
- ftp -s:1.txt
复制代码
作者: GNU 时间: 2010-4-24 13:49 标题: 回复 3楼 的帖子
08年的帖子,你还挖?
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |