[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!
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
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!