Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To get the network card name for just the active connect
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
How To get the network card name for just the active connect
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00961401
Message ID:
00961401
Views:
55
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
Next
Reply
Map
View

Click here to load this message in the networking platform