Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
API for ethernet card serial number
Message
De
15/01/2006 19:22:05
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
10/01/2006 00:57:46
Reza Meamar
Homa Programming Group
Shiraz, Iran
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01078300
Message ID:
01086990
Vues:
15
>>>>>Hi,
>>>>> Can anyone give me some idea or API name to get the serial number of the ethernet card installed on a CPU. How can we call a function of an API? I am working on vfp 7.
>>>>> Thanks in advance,
>>>>>
>>>>>Regards/ Somesh
>>>>
>>>>One of the ways:
>>>>
>>>>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)
>>>>lcOldError = On('error')
>>>>On Error lnResult = CoCreateGuid(@pGUID)
>>>>lnResult = UuidCreateSequential(@pGUID)
>>>>On Error &lcOldError
>>>>lcMacAddress = Substr( Iif( lnResult = 0 And ;
>>>>	StringFromGUID2(pGUID,@rGUID,40) # 0, ;
>>>>	StrConv(Left(rGUID,76),6), "" ), 26,12)
>>>>
>>>>? m.lcMacAddress
>>>>
Cetin
>>>
>>>Dear Cetin,
>>>I read that "a GUID, or globally unique identifier, is a number that Microsoft guarantees is unique throughout the entire world".
>>>I want to know can i use from this unique identifier for making a software LOCK?
>>>Is it possible that this value changed if user change it's Hardware or it's OS ( such as upgrade WIN98 to WIN XP? ) or any change in it's computer?
>>>This GUID generate based on what? hardware? or anything
>>>Thanks for your guide
>>
>>If you're asking for GUID user need not to change something, the value changes with each call. In other words you generate a value once. Generated with few components (such as time,network card,randomizing). You might generate a software lock based on value but you need to use your own imagination to find out how.
>>Cetin
>
>If i understand right, you said "the value changes with each call", but i made an EXE and run it on my computer. in Win98SE and WIN XP it return same value (as 0002A59B16A3)each time i run it. and i run it on my notebook ( ON WIN98SE and WINXP ) and it return (00D0097B44CE) .

Reza (we have the same exact name written as Riza:),
Reread what that procedure prints and what I said.
A GUID is generated as unique on each call, however that procedure prints ethernet card manufacturer's number which doesn't change.
PS: With PPP adapters you might get the same value on different boxes.
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