On Mar 22, 2006, at 9:58 PM, Christian Miller wrote:
On Mar 22, 2006, at 11:38 PM, Norman Palardy wrote:
I ran into an interesting issue with my laptop today. I was not
connected to any network while airport was on, and I had the same
issue when airport was turned off...
System.NetworkInterfaceCount returned zero, and
System.GetNetworkInterface(0).MACAddress raised an OutOfBounds
error.
Why is this? Even if I'm not connected to a network, the MAC
address should still be there. If not, the built in NIC interface
should still be there as well. Any ideas of how to work around
this?
Well since count was 0 why did you try ?
You should have been able to surmise that trying to get the
MacAddress, of an interface that RB already told you did not exist,
would cause an error.
Gee Norm, thanks for the help. ;)
Any time :)
Actually, I hadn't been checking the interface count until I received
the error because pretty much every machine sold now-a-days have some
sort of NIC in it whether it be an ethernet adaptor or a wi-fi
adaptor. Of which, my laptop has both. In the same context, now that
I'm back on my LAN, my iBook's NIC count was apparently > 0 because my
app showed the MAC address. I didn't check to see if the MAC address
was for the built-in ethernet or the airport card. Interesting find
though... apparently, if you're not on a network RB says that your
machine doesn't have a NIC. I wouldn't think that the two would be
related.
Not sure that the NIC's dont get disabled if they are not connected.
It does seem odd that something like ifconfig -a DOES show the various
adapters, whether connected or not.
Not sure if RB isn't reporting only interfaces that are "active" or
that can be connected on. Since neither ethernet nor Airport could in
your case you get a "usable" count of 0.
But to be sure Aaron would be a good person to ask
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>