|
-
May 13th, 2004, 02:59 PM
#1
Thread Starter
Junior Member
password protecting forms?
Hello,
I would like to password protect my program!!
i have a introduction form and i would like to put a password on this, so that when the password is entered the form and programe becomes enabled.
i only want a basic password, nothing fancy!!!
Regards
Homer S
-
May 13th, 2004, 03:10 PM
#2
Hyperactive Member
Nothing fancy. Well this is a really simple example of doing it. I have the two buttons with their enabled property set to false at run time. When the correct username and password are entered I just enable the buttons in my code. It works for what I am doing so I hope it is relevant to what you are looking for. If not I am sure someone will offer a better alternative soon.
VB Code:
Private Sub btnSubmitCredentials_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnSubmitCredentials.Click
Dim strUN As String = txtUserName.Text
Dim strPW As String = txtPassWord.Text
If strUN = "Admin" And strPW = "pass" Then
btnClearTB.Enabled = True
btnUpdateRates.Enabled = True
Else
MsgBox("User not authenticated", _
MsgBoxStyle.OKOnly, "Authentication Error")
txtUserName.Clear()
txtPassWord.Clear()
txtUserName.Focus()
End If
End Sub
All you need to do is modify it to work in your case, which I assume is opening the next form.
-
May 13th, 2004, 03:30 PM
#3
Thread Starter
Junior Member
Thank you very much, i will give it ago!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|