Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MAC Address
Message
De
15/02/2003 06:38:52
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
14/02/2003 13:39:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00753355
Message ID:
00753665
Vues:
17
>Hi All,
>
>Is there a function or sample code in VFP7 that allows you get the MAC address or other hardware id? TIA

Mathew,
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)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform