Using Networking.WirelessZeroConfigNetworkInterface in VB

Last post 02-12-2009 17:16 by ctacke. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-11-2009 15:42

    Using Networking.WirelessZeroConfigNetworkInterface in VB

    I am having problems using the code

    If m_currentAdapter Is NetworkInformation.WirelessZeroConfigNetworkInterface Then

    -----

    End If

    The compiler says WirelessZeroConfigNetworkInterface is a type and cannot be used as an expression. However, all of the c# code I have seen uses this construct.

    I have been able to use DirectCast to cast m_currentAdapter as a WirelessZeroConfigNetworkInterface. However, if it is not a WirelessZeroConfigNetworkInterface but a NetworkInterface or a WirelessNetworkInterface then an exception is thrown, so I have a series of try catch blocks setup to determine if it is one of three interface types. Not what I would like. Any suggestions?

    Second, I can determine the currently connected access point and get all information - name, signal, etc. However, when I ask for nearby accesspoints I get nothing. Is this normal? I would have thought the one I can determine would be included in nearby enumeration. The same for preferred access points - nothing is returned.

    Third, how do I determine if the interface is DHCP enabled?

    David

     

     

  • 02-12-2009 17:16 In reply to

    • ctacke
    • OpenNETCF Staff
    • Top 10 Contributor
    • Joined on 07-27-2007
    • Indiana
    • Posts 2,255

    Re: Using Networking.WirelessZeroConfigNetworkInterface in VB

     First, the equivant to the C# 'is" operator in VB is TypeOf.

    Second, yes the list of Nearby access points should have items in it if there are APs in range.

    DHCP status is found like this:

    myInterface.GetIPProperties().GetIPv4Proerpties().IsDhcpEnabled

Page 1 of 1 (2 items)