我想到这样一个思路:
@echo off
ipconfig /all >1.ini
pause
exit
然后1.ini文件的内容如下:
Windows IP Configuration
Host Name . . . . . . . . . . . . : LENOVO-5086235
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : ....
Ethernet adapter 无线网络连接:
Connection-specific DNS Suffix . : ...
Description . . . . . . . . . . . : Intel(R) PRO/Wireless 3945ABG Network Connection
Physical Address. . . . . . . . . : ...
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : ...
Subnet Mask . . . . . . . . . . . : ...
Default Gateway . . . . . . . . . : ...
DHCP Server . . . . . . . . . . . : ...
DNS Servers . . . . . . . . . . . : ...
Lease Obtained. . . . . . . . . . : ..
Lease Expires . . . . . . . . . . : ...
Ethernet adapter 本地连接:
Media State . . . . . . . . . . . : Media disconnected
Description . . . . . . . . . . . : Intel(R) PRO/1000 PL Network Connection
Physical Address. . . . . . . . . : ...
这样,是否能够根据 Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
这两个值来判断目前活用的网卡,然后再窗口中显示网卡信息,例如:
目前使用网卡为:Intel(R) PRO/Wireless 3945ABG Network Connection
上面是我的思路,不知道成不成,怎么才能实现?或者有别的思路.
恳请高手指点!谢谢.