Il est clair que ce n'est pas avec la daube interprétée que tu montre dessous que tu apprendras à coder.
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Label1.Text = GenerateRandomString(10).ToString End Sub
Function GenerateRandomString(ByVal LongueurPasse As Integer) As String ' Dico Dim allowableChars As String allowableChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#$%&'()*+,-./:;<=>?@[\]^_`{|}~" ' Initialisations GenerateRandomString = "" Dim max As Integer = allowableChars.Length Dim NbAleatoire As Integer Dim rnd As System.Random = New System.Random Dim t As Integer ' Boucle de formation du passe For t = 1 To LongueurPasse NbAleatoire = rnd.Next(0, max) GenerateRandomString = GenerateRandomString & allowableChars.Substring(NbAleatoire, 1) Next End Function
j'espère que tu veux défendre une cause noble
Comment générer un mot de passe aléatoire plus rapide ?
Pas grave car je sais que cela ne le mènera heureusement pas bien loin.Donc pas d’inquiétude !
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Label1.Text = GenerateRandomString(10).ToString End Sub Dans un module : Code Visual Basic : Function GenerateRandomString(ByVal LongueurPasse As Integer) As String ' Dico Dim allowableChars As String allowableChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#$%&'()*+,-./:;<=>?@[\]^_`{|}~" ' Initialisations GenerateRandomString = "" Dim max As Integer = allowableChars.Length Dim NbAleatoire As Integer Dim rnd As System.Random = New System.Random Dim t As Integer ' Boucle de formation du passe For t = 1 To LongueurPasse NbAleatoire = rnd.Next(0, max) GenerateRandomString = GenerateRandomString & allowableChars.Substring(NbAleatoire, 1) Next End Function
Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged If RichTextBox1.Text = True Then End If
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#$%&'()*+,-./:;<=>?@[\]^_`{|}~"
je voudrais un generateur de code qui recherche le mot de passe de 1 a 16 avec ceci:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click RichTextBox1.Text = GenerateRandomString(10).ToString End Sub