Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get local ip
Message
De
16/03/2004 11:36:46
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
16/03/2004 11:34:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00885258
Message ID:
00886721
Vues:
21
>Yes... Is True... ;)
>
>.... And afford add uno more metod, for get MAC Address
>
>PROCEDURE GetMACAddress
>
> Local pGUID,rGUID,lcOldError, lnResult
> Declare integer CoCreateGuid in 'OLE32.dll' string @pguid
> Declare integer StringFromGUID2 in 'OLE32.dll' ;
> string rguid, string @lpsz, integer cchMax
> Declare integer UuidCreateSequential in 'RPCRT4.dll' string @ Uuid
>
> pGUID = replicate(chr(0),16)
> rGUID = replicate(chr(0),80)
>
> lnResult = CoCreateGuid(@pGUID)
> lnResult = UuidCreateSequential(@pGUID)
>
> return substr( iif( lnResult = 0 and ;
> StringFromGUID2(pGUID,@rGUID,40) # 0, StrConv(left(rGUID,76),6), "" ), 26,12)
>
>ENDPROC

:) Add 1854 to lnResult (or was it 1824-local only for standalone computers)
Update : Mixed with UniqueID. This was sequential. Mine version looks like :
pGUID=replicate(chr(0),16)
rGUID=replicate(chr(0),80)

lcOldError = On('error')
On Error lnResult = CoCreateGuid(@pGUID)
lnResult = UuidCreateSequential(@pGUID) 
On Error &lcOldError

return substr( iif( lnResult = 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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform