Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get MAC address
Message
De
24/03/2003 15:36:02
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00768872
Message ID:
00769423
Vues:
21
I believe this will only return the original MAC adress the system finds. If you change network cards or add a second one, it'll still report the original one. In fact if you don't have a network adapter originally installed, it'll create a "phony" one for you!

Rick

>I found this code here in UT.
>
>
>Local pGUID,rGUID,lpVersionInfo
>Declare integer CoCreateGuid in 'OLE32.dll' string @pguid
>Declare integer StringFromGUID2 in 'OLE32.dll' ;
>  string rguid, string @lpsz, integer cchMax
>declare short GetVersionEx in win32API ;
>  string @ lpVersionInfo
>lpVersionInfo = chr(128+5*4)+replicate(chr(0),128+5*4-1)
>GetVersionEx(@lpVersionInfo)
>
>pGUID=replicate(chr(0),16)
>rGUID=replicate(chr(0),80)
>
>If ASC(substr(lpVersionInfo, 5))>4 && 2000/XP or later
>  Declare integer UuidCreateSequential in 'RPCRT4.dll'  string @ Uuid
>ENDIF
>
>RETURN substr( iif( ;
>	IIF(ASC(substr(lpVersionInfo, 5))>4, ;
>	UuidCreateSequential(@pGUID), CoCreateGuid(@pGUID)) = 0 ;
>	and StringFromGUID2(pGUID,@rGUID,40) # 0, ;
>    StrConv(left(rGUID,76),6), "" ), 26,12)
>
>
>Best
>Andrzej Multan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform