Page 1 sur 1

[..] Clés de registre - Ecrire, lire et afficher

Posté : sam. 03 août 2013 14:08
par hardfloor
Bonjour Mikell :D :D

Alors j'ai un petit soucis :oops: :oops:

Code : Tout sélectionner

$Rand = _TestRandom(3)

         RegWrite("HKEY_CURRENT_USER\Software\Sniper", "Key", "REG_SZ", $Rand)
   $Rand1 = RegRead("HKEY_CURRENT_USER\Software\Sniper\Key", "REG_SZ")
         
Msgbox(4000,"Felicitation", "Votre clé a bien été enregistrée: ", $Rand1)



 Func _TestRandom($Long)
Local $lPos , $i, $p, $RndStr
Const $Str = "123456789"
For $i = 1 To $Long
$lPos = Int(Random(1, StringLen($Str)))
$p = StringMid($Str, $lPos + 1, 1)
$RndStr = $RndStr & $p
Next
Return $RndStr

EndFunc
 
Ma clé est bien crée dans le registre (Je vérifie manuellement) , Mais je n'arrive pas à l'afficher dans la messagebox.

Il y a un truc que j'ai loupé??

Re: [..]Clés de registre - Ecrire, lire et afficher

Posté : sam. 03 août 2013 14:30
par PandiPanda
A premiere vue ...

Code : Tout sélectionner

Msgbox(4000,"Felicitation", "Votre clé a bien été enregistrée: "[color=#FF0000], $Rand1[/color])
devrai etre ceci?

Code : Tout sélectionner

Msgbox(4000,"Felicitation", "Votre clé a bien été enregistrée: "[color=#00BF00]&$Rand1[/color])

Re: [..]Clés de registre - Ecrire, lire et afficher

Posté : sam. 03 août 2013 14:55
par hardfloor
Edit: Oui Merci bien l'ami :mrgreen: :mrgreen:

Bon je vais mettre mes lunettes du coup....... 8)

Et par exemple si je separe et met seul dans un script cette partie
pareil ca ne m'affiche rien.......

Code : Tout sélectionner

$Rand1 = RegRead("HKEY_CURRENT_USER\Software\Sniper\Key", "REG_SZ")
Msgbox(4000,"Felicitation", "Votre clé a bien été enregistrée: "&$Rand1)
 
saurais tu pourquoi??

Re: [..]Clés de registre - Ecrire, lire et afficher

Posté : sam. 03 août 2013 14:56
par PandiPanda
En fait y'avais 2 erreurs ^^

celle que j'ai dites plus haut et celle ci;

Code : Tout sélectionner

$Rand1 = RegRead([color=#FF0000]"HKEY_CURRENT_USER\Software\Sniper\Key", "REG_SZ"[/color])
doit etre ...

Code : Tout sélectionner

$Rand1 = RegRead([color=#008000]"HKEY_CURRENT_USER\Software\Sniper", "Key"[/color])

Re: [..]Clés de registre - Ecrire, lire et afficher

Posté : sam. 03 août 2013 15:20
par hardfloor
bon et maintenant,
si je veux ajouter ce nombre aleatoire à une autre chaine comment je fais pour qu'il soit pris en compte?

Code : Tout sélectionner

_MD5($Rand1 + $rand2 + $Rand3)
 
ou

Code : Tout sélectionner

_MD5($Rand1 & $rand2 & $Rand3)
 
ou

Code : Tout sélectionner

_MD5($Rand1 , $rand2 , $Rand3)
 
:?: :?:

Re: [..]Clés de registre - Ecrire, lire et afficher

Posté : sam. 03 août 2013 15:36
par PandiPanda
Cela peut vous aider? ^^

Code : Tout sélectionner

Local $nb1 = 1
Local $nb2 = "2"
MsgBox(0,"","$nb1+$nb2 = "&($nb1+$nb2)&@CRLF&"$nb1 & $nb2 = "&($nb1&$nb2))

Re: [..]Clés de registre - Ecrire, lire et afficher

Posté : sam. 03 août 2013 15:44
par hardfloor
Ok merci bcp^^
Vi maintenant j'ai compris la subtilité :wink: :wink:

Re: [..] Clés de registre - Ecrire, lire et afficher

Posté : sam. 03 août 2013 22:09
par mikell
hardfloor a écrit :Bonjour Mikell :D :D
Bonjour à toi :mrgreen:
Mais ya d'autres intervenants très efficaces sur ce forum, la preuve...
Donc, le Panda ayant parfaitement répondu à tes questions, un petit [R] dans le titre de ton 1er post please