i wrote this function to get a unique code of a pc.
Updated it and changed the name
Here is the code:
Func _UniquePCCode() Local $return , $first Local $pass = @ComputerName $encrypt = _Stringencrypt( 1 , $pass , $pass ) & @OSLang & @OSTYPE & @OSVersion & @OSServicePack & DriveGetSerial("C:\") $split = StringSplit( $encrypt , "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z" ) For $a = 1 to $split[0] For $b = 65 to 90 If StringInStr( $split[$a] , Chr($B) ) Then $split[$a] = StringReplace( $split[$a] , Chr($B), $b ) EndIf Next $first &= $split[$a] Next StringStripWS( $first , 8 ) $split1 = StringSplit( $first , "_" ) For $d = 1 to $split1[0] $return &= $split[$d] Next $return = StringMid( $return , StringLen( $return ) / 2 - 3 , 8 ) $second = Hex($return) $return = "" $split = StringSplit( $second , "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z" ) For $a = 1 to $split[0] For $b = 65 to 90 If StringInStr( $split[$a] , Chr($B) ) Then $split[$a] = StringReplace( $split[$a] , Chr($B), $b ) EndIf Next $return &= $split[$a] Next $return = StringMid( $return , StringLen( $return ) / 2 - 3 , 8 ) Return $return EndFunc ;==>_UniquePCCode
Note you need _stringencrypt from string.au3 for it.
Regards
Edited by Daniel W., 30 June 2006 - 04:38 PM.




