A login program that I wrote that will allow the user to login and if the user is a registered it will display the username and its pictures. The code is very easy to understand and use that I wrote using Microsoft Visual Foxpro 9.
My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
My telephone number at home here in Bacolod City, Negros Occidental is (034) 4335675.
Table Structure and Sample Records
Sample Program Output
Program Listing
Password Form
Object: Form1 Procedure: Init
=====================================
thisform.text2.value =0
thisform.text2.Visible= .F.
thisform.txtPassword.PasswordChar = "*"
thisform.txtusername.SetFocus
Ok Button
Object: Command1 Procedure: Click
========================================
SET DEFAULT TO d:\vfp\password\
SELECT users
LOCATE FOR ALLTRIM(LOWER(username)) == ALLTRIM(LOWER(thisform.txtusername.value)) AND ALLTRIM(LOWER(password)) = ALLTRIM(LOWER(thisform.txtpassword.Value))
IF FOUND() then
DO form menu
thisform.Release
thisform.Hide
RETURN .t.
endif
if thisform.text2.Value <3 then
thisform.text2.Value = thisform.text2.Value +1
thisform.txtusername.Value=""
thisform.txtpassword.Value =""
thisform.txtusername.SetFocus
thisform.label1.caption ="User login attempt number " + TRANSFORM(thisform.text2.value) + "."
endif
IF thisform.text2.Value = 3 then
MESSAGEBOX("Please contact your programmer to solve this problem")
thisform.txtusername.Enabled= .F.
thisform.txtpassword.Enabled= .F.
thisform.command1.Enabled= .F.
ENDIF
Cancel Button
Object: Command2 Procedure: Click
========================================
thisform.Release
Menu Form
Object: Form1 Procedure: Init
SELECT users
fullname = TRIM(firstname) + " " + TRIM(lastname)
thisform.label1.Caption = "Welcome " +fullname
thisform.image1.Picture=TRIM(pixpath)
thisform.image1.Visible= .T.
Close Button
Object: Command1 Procedure: Click
=========================================
thisform.Release
thisform.hide
DO FORM password
DOWNLOAD SOURCE CODE HERE
No comments:
Post a Comment