实在是有点急了,自己写了一个不管用,求助大虾!
需求:从ipconfig命令的输出中提出需要的以192.168.1.10开始的ip地址,例如:可能有192.168.1.1和192.168.1.100,那么需要提取出192.168.1.100,然后将该ip地址存入到某一变量中保存,以做后用。
下面是一段ipconfig可能的输出结果:(***注意,其中会有空行)
-----------------------------------------------
D:\>ipconfig
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : users.bbs.com
IP Address. . . . . . . . . . . . : 10.21.5.1
Subnet Mask . . . . . . . . . . . : 255.255.252.0
IP Address. . . . . . . . . . . . : fe80::21f:e2ff:fe10:54c1%4
Default Gateway . . . . . . . . . : 10.21.7.254
Ethernet adapter Local Area Connection 9:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.1.100
Subnet Mask . . . . . . . . . . . : 255.255.255.0
IP Address. . . . . . . . . . . . : fe80::5a2c:80ff:fe13:9263%7
Default Gateway . . . . . . . . . : 192.168.1.1
Tunnel adapter Teredo Tunneling Pseudo-Interface:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : fe80::ffff:ffff:fffd%5
Default Gateway . . . . . . . . . :
Tunnel adapter Automatic Tunneling Pseudo-Interface:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : fe80::5efe:192.168.1.100%2
Default Gateway . . . . . . . . . :
Tunnel adapter Automatic Tunneling Pseudo-Interface:
Connection-specific DNS Suffix . : users.bbs.com
IP Address. . . . . . . . . . . . : fe80::5efe:10.21.5.1%2
Default Gateway . . . . . . . . . :
-----------------------------------------------------------------------
谢谢!
[ Last edited by ruson07 on 2010-12-10 at 11:24 ]
需求:从ipconfig命令的输出中提出需要的以192.168.1.10开始的ip地址,例如:可能有192.168.1.1和192.168.1.100,那么需要提取出192.168.1.100,然后将该ip地址存入到某一变量中保存,以做后用。
下面是一段ipconfig可能的输出结果:(***注意,其中会有空行)
-----------------------------------------------
D:\>ipconfig
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : users.bbs.com
IP Address. . . . . . . . . . . . : 10.21.5.1
Subnet Mask . . . . . . . . . . . : 255.255.252.0
IP Address. . . . . . . . . . . . : fe80::21f:e2ff:fe10:54c1%4
Default Gateway . . . . . . . . . : 10.21.7.254
Ethernet adapter Local Area Connection 9:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.1.100
Subnet Mask . . . . . . . . . . . : 255.255.255.0
IP Address. . . . . . . . . . . . : fe80::5a2c:80ff:fe13:9263%7
Default Gateway . . . . . . . . . : 192.168.1.1
Tunnel adapter Teredo Tunneling Pseudo-Interface:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : fe80::ffff:ffff:fffd%5
Default Gateway . . . . . . . . . :
Tunnel adapter Automatic Tunneling Pseudo-Interface:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : fe80::5efe:192.168.1.100%2
Default Gateway . . . . . . . . . :
Tunnel adapter Automatic Tunneling Pseudo-Interface:
Connection-specific DNS Suffix . : users.bbs.com
IP Address. . . . . . . . . . . . : fe80::5efe:10.21.5.1%2
Default Gateway . . . . . . . . . :
-----------------------------------------------------------------------
谢谢!
[ Last edited by ruson07 on 2010-12-10 at 11:24 ]


