Dim username As String
Dim password As String
Private Sub Command1_Click()
If Check1.Value = vbChecked Then
Open App.Path & "\1.txt" For Output As #1
Print #1, username
Print #1, password
Close #1
End If
End Sub
Private Sub Form_Load()
If Dir(App.Path & "\1.txt") <> "" Then
Open App.Path & "\1.txt" For Input As #1
Line Input #1, username
Line Input #1, password
Close #1
Else
username = Text1.Text
password = Text2.Text
End If
End Sub