Get the IP address of WIFI interface

Jun Hu hujun.work at gmail.com
Sun May 15 19:07:20 EDT 2011


On Sun, May 15, 2011 at 2:14 PM, Andrew Berg <bahamutzero8825 at gmail.com>wrote:

>
> One thing I found out about Win32_NetworkAdapterConfiguration is that it
> only contains /current/ information and not the stored info that it uses
> when making an initial connection (you can see and edit this info in the
> Network and Sharing Center applet). The difference is that if you're
> offline, that WMI object will have no useful info at all. You can find
> the info in the registry if you know what the UUID (or whatever it is)
> of (or assigned to) the interface (it's in
>
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces).
> The OP said the card would be connected, so it might not be an issue,
> but I think it's important to know that. Wouldn't want you to suddenly
> get blank strings or exceptions and not know why. ;-)
>
> Thanks for the reminder, however, it seems the IPAddress
of Win32_NetworkAdapterConfiguration will be 0.0.0.0 if the interface is NOT
connected (at least that is the result on my winxp), so I think we are safe
here.   ^_^
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110515/43f109b5/attachment.html>


More information about the Python-list mailing list