Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To get the network card name for just the active con
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
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:
00961457
Vues:
4
This message has been marked as a message which has helped to the initial question of the thread.
>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.
>

You can try adding the domain to your query: (?)
loloc = createobject('WbemScripting.SWbemLocator')
lcDomain = getenv('USERDNSDOMAIN')
omgr = loloc.ConnectServer()
oNetwork = omgr.execquery("select * from Win32_NetworkAdapterConfiguration where IPEnabled='true' and DNSDomain='" + lcDomain + "'")
FOR EACH objNic IN oNetwork
	? objNic.Caption
ENDFOR
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform