03-03-2007, 12:36 PM
Difficultly: 1/5
Time: Three minutes
Hello, I am completely new here, but I know my way around VB6 a little, so I worked up a code that remembers your username and password if you check a button.
Here goes:
OK, first open up your frmLogin and add a check box and call it RPass. Then double click on the connect button and add this code to the top, right under the Private sub picConnect_click():
Then add this into the form_load()
Then up at the top, write this in:
That works for me.
Just make sure to keep the Trim part of the code there.
That should do it, but you might have to create a file called data.ini, because it might runtime.
~Braydok
Time: Three minutes
Hello, I am completely new here, but I know my way around VB6 a little, so I worked up a code that remembers your username and password if you check a button.
Here goes:
OK, first open up your frmLogin and add a check box and call it RPass. Then double click on the connect button and add this code to the top, right under the Private sub picConnect_click():
Code:
If RPass.Value = 1 Then
Open "Data.ini" For Output As #f
Print #f, "[SETTINGS]"
Print #f, "Last User= "
Print #f, txtName
Print #f, "Last Password= "
Print #f, txtPassword
Close #f
Else
End If
Then add this into the form_load()
Code:
f = FreeFile
Dim n
Dim O
Dim usr
Dim t
Dim pass
On Error GoTo Error
Open "Data.ini" For Input As #f
Input #f, n
Input #f, O
Input #f, usr
Input #f, t
Input #f, pass
Close #f
RPass.Value = 1
txtName.Text = usr
txtPassword.Text = pass
Error:
Then up at the top, write this in:
Code:
public f as Integer
That works for me.
Just make sure to keep the Trim part of the code there.
That should do it, but you might have to create a file called data.ini, because it might runtime.
~Braydok