There's several ways to do a logon and return the results. Besides the TasTrade sample there's a great example by Doug Hennig in FoxTalk. You can get the current windows user, use an INI file, etc but the most common is probably a logon from. Here's a very simple one.
DO FORM logon TO lLogon
This will RETURN a value from the logon form to lLogon
Create a Users table with userid and password
Create a logon form
Set the WindowType property of the form to 1 to make the form modal
Add a property to the form named lLogonSuccessful (default of .F. is fine)
In the UNLOAD event of the form add RETURN Thisform.lLogonSuccessful
Add labels and textboxes for User ID and Password
txtUserID and txtPassword for this example
In the PasswordChar property of txtPassword enter *
Add OK and Cancel buttons
In Click event of the OK button search for the txtUserID and txtPassword values in the users table
LOCATE FOR users.userid = Thisform.txtUserID.Value
IF !FOUND()
? CHR(7)
WAIT WINDOW "User ID is not found"
Thisform.txtUserID.SetFocus
ELSE
IF Thisform.txtPassword == users.password
Thisform.lLogonSuccessful = .T.
Release Thisform
ELSE
? CHR(7)
WAIT WINDOW "Password is incorrect"
Thisform.txtPassword.SetFocus
ENDIF
ENDIF
In Click event of the cancel button add Release Thisform
This will return the default value of .F. of .lLogonSuccessful
Now your lLogon value will be true or false and you can go from there
? lLogon
HTH Kinda early for me for a Sunday morning so I'll leave any double checking code here to you. ha