Valeur de clef (Regsitre en VBNET)

Résolu
phenX Messages postés 704 Date d'inscription mercredi 4 mai 2005 Statut Membre Dernière intervention 28 août 2012 - 13 avril 2006 à 16:30
 Utilisateur anonyme - 13 avril 2006 à 17:15
jour, je cherche a récupéré l'ensemble des valeurs de cete clef mais je n'y arrive pas

Private Sub TbBoot_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TbBoot.Click
Dim Entree As String
For Each Entree In Registry.LocalMachine.GetValueNames(HKEY_LOCAL_MACHINE\SQoftware\Microsoft\CurrentVersion\Run")
ChkLstBoot.Items.Add(Entree)
MsgBox("Opération Terminé")
Next
End Sub

merci

4 réponses

Utilisateur anonyme
13 avril 2006 à 16:46
Salut,

Tu t'y prends d'une drole de manière. D'abord il faut ouvrir la clé, lister les valeurs qu'elle contient, et la fermer.
Ca donne:

Dim RegKey As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", False)
Dim Entree As String
For Each Entree In RegKey.GetValueNames()
ChkLstBoot.Items.Add(Entree)
MsgBox("Opération Terminé")
Next

Kenji

<HR width="100%" SIZE=2>


Merci de cliquer sur "Réponse acceptée" si une réponse vous convient.
3
phenX Messages postés 704 Date d'inscription mercredi 4 mai 2005 Statut Membre Dernière intervention 28 août 2012
13 avril 2006 à 16:49
super!! merci!!!
0
phenX Messages postés 704 Date d'inscription mercredi 4 mai 2005 Statut Membre Dernière intervention 28 août 2012
13 avril 2006 à 16:49
super!! merci!!!
0
Utilisateur anonyme
13 avril 2006 à 17:15
J'ai d'ailleur oublier de fermer la clé.

[...]
MsgBox("Opération Terminé")
Next
RegKey.Close()

Kenji

<HR width="100%" SIZE=2>


Merci de cliquer sur "Réponse acceptée" si une réponse vous convient.
0
Rejoignez-nous