Results 1 to 3 of 3

Thread: [RESOLVED] [2005] Detect if on a wireless connection

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2007
    Posts
    28

    Resolved [RESOLVED] [2005] Detect if on a wireless connection

    One would think that this may be simple with the .NET framework, but I'm having a very difficult time trying to "detect if the a computer is using a wireless network or wired LAN".

    Does anyone have any tips on if this can actually be done and if so, any pointers on where to get started?

    Thanks!

  2. #2
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: [2005] Detect if on a wireless connection

    Try this

    Code:
            Dim adapters As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces()
            Dim adapter As NetworkInterface
            Dim num As Integer = 0
            For Each adapter In adapters
                Debug.WriteLine(num.ToString.PadRight(5, " "c) & adapter.Name)
                Debug.WriteLine(num.ToString.PadRight(5, " "c) & adapter.Description)
                Debug.WriteLine(num.ToString.PadRight(5, " "c) & adapter.NetworkInterfaceType)
                Debug.WriteLine(num.ToString.PadRight(5, " "c) & adapter.OperationalStatus.ToString)
                'Debug.WriteLine(adapter.etc much more
                num += 1
            Next
    this is my output from debug

    0 Bluetooth Network
    0 Bluetooth LAN Access Server Driver - Packet Scheduler Miniport
    0 6
    0 Down
    1 Wireless Network Connection
    1 Intel(R) PRO/Wireless 2200BG Network Connection - Packet Scheduler Miniport
    1 6
    1 Up
    2 Local Area Connection
    2 Broadcom 440x 10/100 Integrated Controller - Packet Scheduler Miniport
    2 6
    2 Down
    3 MS TCP Loopback interface
    3 MS TCP Loopback interface
    3 24
    3 Up
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2007
    Posts
    28

    Re: [2005] Detect if on a wireless connection

    You my friend.. are wonderful. For those looking for this answer, dbasnett provided a perfect working example of how to iterate through your network devices. Props!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width