Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
About getdiskserial
Message
De
01/02/2008 05:57:46
Suhas Hegde
Dental Surgeon
Sirsi, Inde
 
 
À
31/01/2008 04:42:42
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
01287031
Message ID:
01287867
Vues:
9
>>>>>>Sometimes getdiskserial fails. It means that returns empty string. It depends on the user. But with the same user (poweruser), in different computer (in the same network) does the job. I can have the correct string, changing the user (as administrator works), but the poweruser has ( or so it seems) the complete control. I do not understand this behavior.
>>>>>>Sombody can help me to solve this problem?
>>>>>>Thnx in advance
>>>>>
>>>>>Don't use diskserial for copy protect. Use ethernet ID for that. That's a more reliable way.
>>>>You mean the MAC address, I suppose.
>>>>
>>>>Peter
>>>
>>>Yes... Cetin said that "MAC address can be changed, too", but it's hard to do for an average user.
>>
>>I really don't know ethernet ID. Is it easy to use and where to search ?
>
>I can't remembered who gived me this function, it works good:
>
>
>Local pGUID,rGUID
>Declare integer CoCreateGuid in 'OLE32.dll' ;
>  string @pguid
>Declare integer StringFromGUID2 in 'OLE32.dll' ;
>  string rguid, string @lpsz, integer cchMax
>
>pGUID=replicate(chr(0),16)
>rGUID=replicate(chr(0),80)
>
>If "5." $ OS() && 2000/XP
>  Declare integer UuidCreateSequential in 'RPCRT4.dll'  string @ Uuid
>  lcMacAddress = iif( UuidCreateSequential(@pGUID) = 0 ;
>    and StringFromGUID2(pGUID,@rGUID,40) # 0, ;
>    substr(StrConv(left(rGUID,76),6),26,12), "" )
>* VFP7
>*  CLEAR DLLS 'UuidCreateSequential'
>Else
>  lcMacAddress = iif( CoCreateGuid(@pGUID) = 0 ;
>    and StringFromGUID2(pGUID,@rGUID,40) # 0, ;
>    substr(StrConv(left(rGUID,76),6),26,12), "" )
>ENDIF
>? lcMacAddress
>*VFP7
>*CLEAR DLLS 'WNetGetUser','GetComputerName','CoCreateGuid','StringFromGUID2'
>
>
hi,
I think i use that code only to find it returned only 1 MAc address. If a Bluetooth was installed then You couldnt get LAN card address. These Bluetooth dongals can be removed and put as and when required making it error while reading when the Dongal is present or not

Suhashegde
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform