Dim cle As String, cle2 As String, cle3 As String, cle4 As String, toto As Integer, longueur_cle As Integer, i As Integer Randomize() longueur_cle = 5 For i = 1 To longueur_cle toto = Int((35 * Rnd())) If toto > 9 Then toto = toto + 7 cle = cle & Chr(toto + 48) Next For i = 1 To longueur_cle toto = Int((35 * Rnd())) If toto > 9 Then toto = toto + 7 cle2 = cle2 & Chr(toto + 48) Next For i = 1 To longueur_cle toto = Int((35 * Rnd())) If toto > 9 Then toto = toto + 7 cle3 = cle3 & Chr(toto + 48) Next For i = 1 To longueur_cle toto = Int((35 * Rnd())) If toto > 9 Then toto = toto + 7 cle4 = cle4 & Chr(toto + 48) Next TextBox1.Text = cle & "-" & cle2 & "-" & cle3 & "-" & cle4 RichTextBox1.Text = RichTextBox1.Text & cle & "-" & cle2 & "-" & cle3 & "-" & cle4 & vbCrLf Label2.Text = Val(Label2.Text + 1)
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionFunction code(ByVal numero As Integer) Dim cle As String, cle2 As String, cle3 As String, cle4 As String, toto As Integer, longueur_cle As Integer, i As Integer longueur_cle = 10 If numero = 1 Then For i = 1 To longueur_cle toto = Int((35 * Rnd())) If toto > 9 Then toto = toto + 7 cle = cle & Chr(toto + 48) code = cle Next ElseIf numero = 2 Then For i = 1 To longueur_cle toto = Int((35 * Rnd())) If toto > 9 Then toto = toto + 7 cle2 = cle2 & Chr(toto + 48) code = cle2 Next ElseIf numero = 3 Then For i = 1 To longueur_cle toto = Int((35 * Rnd())) If toto > 9 Then toto = toto + 7 cle3 = cle3 & Chr(toto + 48) code = cle3 Next ElseIf numero = 4 Then For i = 1 To longueur_cle toto = Int((35 * Rnd())) If toto > 9 Then toto = toto + 7 cle4 = cle4 & Chr(toto + 48) code = cle4 Next End If End Function
je vais commencé par lire cette aide ^^.