Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To get the network card name for just the active connect
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
How To get the network card name for just the active connect
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00961401
Message ID:
00961401
Vues:
54
I'm trying to get an capture the network card name using WMI, the following code will return the network card names but it includes 4 entries on my workstation, and I only have one active connection which in my case is the last entry. I'm hoping someone has some experience with this.
loloc = createobject('WbemScripting.SWbemLocator')
omgr = loloc.ConnectServer()
oNetwork = omgr.execquery("select * from Win32_NetworkAdapterConfiguration where IPEnabled='true'")
FOR EACH objNic IN oNetwork
	? objNic.Caption
ENDFOR 
On my machine it returns:
[00000000] 3Com EtherLink 10/100 PCI TX NIC (3C905B-TX)
[00000007] Microsoft TV/Video Connection
[00000008] Realtek RTL8139 Family PCI Fast Ethernet NIC
[00000009] Intel(R) PRO/1000 CT Network Connection
and the last entry is my active connection.

Also, does anyone know if you can determine if the connection is a wired or wireless connection?

Thanks

Kirk
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform