Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get Network Adapter Address (MAC?)
Message
De
26/09/2001 17:49:36
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00477977
Message ID:
00561244
Vues:
55
>I could but that is too messy and I don't like the COMMAND window flash across the screen. The OCX from CompuServer that Rick Bean alerted me to does the trick flawlessly.

Based on original solution (the MAC address is only part of the GUID):
function GetMAC
local lcStrucGUID, lcMAC, lnLoop
declare integer CoCreateGuid in Ole32.dll string @lcGUIDStruc

lcStrucGUID=space(16)

if CoCreateGuid(@lcStrucGUID) # 0 then
   return ""
endif
lcMAC = ""
for lnLoop=11 to 16
	lcMAC = lcMAC+right(transform(asc(substr(lcStrucGUID,lnLoop,1)),"@0"),2)+"-"
endfor

return left(lcMAC,len(lcMAC)-1)
It works in my system (got my NIC MAC perfectly).

bye
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform