What needs to be thrown in where the arrow is pointing in the attachment?
I am a nub in VB. Also, I am using Visual Studio 2008.
Code:Declare function GenerateCode Lib "kernel32" ALias "_lopen" (ByVal lpPathName As String, By Val ireadwrite As Long)As Long Public Class Form1 Private Sub Text1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Text1.TextChanged End Sub Private Sub Command1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Command1.Click Text1 = GenerateCode() 'make sure ur textbox is called Text1 End Sub End Class 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


LinkBack URL
About LinkBacks




Reply With Quote




Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum