Thanks Metin, it works good also to me. What is the meaning of this string? The serial disk or what else?
Francesco
>>>>>>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()
> 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'
>
>