First of all,thank you, above all enthusiastic response. But I think I do not have a clear description of the question. I do not need have a list of IP,DNS,etc on all NICs. In fact, I would like to know which NIC is working,then get the IP,DNS,MAC,etc on that NIC.

For example, c:>ipconfig/all

Windows IP Configuration Host Name . . . . . . . . . . . . : perl Primary Dns Suffix . . . . . . . : Node Type . . . . . . . . . . . . : Unknown IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No Ethernet adapter VMware Network Adapter VMnet8: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : VMware Virtual Ethernet Ad +apter for VMnet8 Physical Address. . . . . . . . . : 00-50-56-C0-11-08 Dhcp Enabled. . . . . . . . . . . : No IP Address. . . . . . . . . . . . : 192.168.227.1 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : Ethernet adapter VMware Network Adapter VMnet1: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : VMware Virtual Ethernet Ad +apter for VMnet1 Physical Address. . . . . . . . . : 00-50-56-C0-11-01 Dhcp Enabled. . . . . . . . . . . : No IP Address. . . . . . . . . . . . : 192.168.138.1 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : Ethernet adapter 无线网络连接: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Broadcom 802.11b/g WLAN Physical Address. . . . . . . . . : 00-1A-73-2A-E6-BC Dhcp Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes IP Address. . . . . . . . . . . . : 192.168.0.103 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.0.1 DHCP Server . . . . . . . . . . . : 192.168.0.1 DNS Servers . . . . . . . . . . . : 192.168.0.1 Lease Obtained. . . . . . . . . . : 2008年11月20日 23:35:02 Lease Expires . . . . . . . . . . : 2008年11月27日 23:35:02 Ethernet adapter 本地连接: Media State . . . . . . . . . . . : Media disconnected Description . . . . . . . . . . . : Broadcom NetLink (TM) Giga +bit Ethernet Physical Address. . . . . . . . . : 00-17-A4-DD-F3-26
Now, I'm using a wireless network, so I hope the perl script will Automatically get the following:
Physical Address. . . . . . . . . : 00-1A-73-2A-E6-BC IP Address. . . . . . . . . . . . : 192.168.0.103 Default Gateway . . . . . . . . . : 192.168.0.1 DHCP Server . . . . . . . . . . . : 192.168.0.1 DNS Servers . . . . . . . . . . . : 192.168.0.1
Poor English skills, understanding.

Thanks.


In reply to Re^2: How can I get current IP,DNS,MAC,GW under XP? by perllee
in thread How can I get current IP,DNS,MAC,GW under XP? by perllee

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.