>Hi,
> I found ur code to get the HD info very helpful.
> Can u give some idea or API name to get the serial number of the ethernet card installed on a CPU. I am working on vfp 7.
> Thanks in advance,
Hi Somesh,
I do not know how to get the SN of the ethernet card, I do not see any property for it (
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_networkadapter.asp or
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_networkadapterconfiguration.asp) if you want the MAC Address, you can try something like this:
local loWMI, loLocator, loNAs, loNA
clear
try
loLocator = createObject("wbemScripting.SwbemLocator")
loWMI = loLocator.ConnectServer()
catch
loWMI = null
endtry
if not Isnull(loWMI)
loNAs = loWMI.ExecQuery('Select * from Win32_NetworkAdapterConfiguration where IPEnabled=true and DNSDomain="' + Getenv("USERDNSDOMAIN") + '"')
for each loNA in loNAs
with loNA
? .Description, .MACAddress, .DNSHostName, .DNSDomain
endwith
endfor
endif
"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