Detect Connection Device Name [RESOLVED]
Hello everyone,
I've been making a simple updater type program and I have litterally hit a speed bump. If people are not on a 10 BaseT I need to prevent the program from downloading the larger files.
Here is the kicker, the Air Card that some of these people use show up as a LAN connection but it is really only as fast as a 28.8 dialup. So I need to detect the name of the card/device that is actually being used for the connection.
Ideas, suggestions, any help will be very appreciated.
Zheldon
Re: Detect Connection Device Name
Well I think I might have found my own answer, or at least a good path to start down. If some one knows better please let me know.
http://support.microsoft.com/?kbid=223025
Re: Detect Connection Device Name
I know know if this could help, but if I'm not mistaken can you request the name with the snmp protocol.
Here is a library (don't know if this one is any good)
http://www.c-sharpcorner.com/Code/2002/Sept/SnmpLib.asp
Also look at this
http://www.experts-exchange.com/Prog..._20592398.html
Re: Detect Connection Device Name
If the devices with the AirCard do not have any other network adapters enabled, then this will tell you the name of the Instance Name of the adapter.
I have a 1394, and two for the 10/100 adapter, all enabled. (NDis = 0)
Quote:
Active: True
InstanceName: Broadcom 802.11b/g WLAN
NdisTransmitsOk: 370459
Active: True
InstanceName: HP WLAN 54g W450 Network Adapter - Packet Scheduler Miniport
NdisTransmitsOk: 370459
VB Script (.vbs) Open with cscript or wscript. Search for recent posts by me.
VB Code:
On Error Resume Next
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
arrComputers = Array("MYPCNAME")
For Each strComputer In arrComputers
WScript.Echo
WScript.Echo "=========================================="
WScript.Echo "Computer: " & strComputer
WScript.Echo "=========================================="
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI")
Set colItems = objWMIService.ExecQuery("SELECT * FROM MSNdis_TransmitsOk", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
WScript.Echo "Active: " & objItem.Active
WScript.Echo "InstanceName: " & objItem.InstanceName
WScript.Echo "NdisTransmitsOk: " & objItem.NdisTransmitsOk
WScript.Echo
Next
Next