Créditos a baller_tk:
Código: Seleccionar todo
Private Sub Command1_Click()
Text1 = GenerateCode() 'make sure ur textbox is called Text1
End Sub
Public Function GenerateCode()
strInputString = "1234567890abcdefghijklmnopqrstuvwxyz" 'these are the characters which will be in the password
intLength = Len(strInputString)
intNameLength = 7 'edit this according to how long u want ur password to be
Randomize ' jus to make it random :D
strName = ""
For intStep = 1 To intNameLength
intRnd = Int((intLength * Rnd) + 1)
strName = strName & Mid(strInputString, intRnd, 1)
Next
GenerateCode = strName
End Function
Muy fácil de lograr, pero si tienes dudas postea una vez más!
DUNEDAI escribió:ok, entonces podemos ayudarnos mutuamente, yo he creado uno con el video de skyweb, encryptacion rc4, ahora quiero agregarle un módulo de otra encryptación por ejemplo aes, blowfish, pero me da problemas... Esta tarde le he agregado el generador de contraseñas y funciona ok.
Lo que creo que sucede es que Rijndael (Advanced Encryption Standard) no posee la función EncryptString sino que usa EncryptData.
Si escribís el código, por ejemplo:
Código: Seleccionar todo
File = EncryptData.(File, Textbox1.Text) 'Donde el textbox es la password
Debería funcionar, pero no es seguro, yo también estoy aprendiendo a programar :D
Sino podrías fijarte dentro del módulo de clase del método de encriptación y allí ver que funciones privadas puede ejecutar.
Saludos!