On May 2, 2006, at 6:08 PM, Jonathon Bevar wrote:
Ok I figured it out myself.
// Read User/Password Code from text file
Dim strin As TextInputStream
Dim f As FolderItem
Dim userName, userPassword1, userPassword2 as String
f = GetFolderItem("PatientLog_UPC.ini")
If f.exists and f <> Nil then
strin = f.OpenAsTextFile
userName = strin.ReadLine
userPassword2 = strin.ReadLine
strin.Close
end if
userPassword1 = MD5(uPassword.text)
if uName.text = userName and userPassword1= userPassword2 then
self.Close
Logged.ShowModal
else
MsgBox("The User's Name and/or Password are NOT listed as users
on this system. Either re-try entering the User Name and Password
or create a NEW User." + EndOfLine+ EndOfLine + "Please press 'OK'
to continue...")
end
And it works great.
It won't if f.OpenAsTextFile fails; instead you'll get a
NilObjectException. I posted some code that fixed this earlier. You
might also find my little article on how to read a text file useful
<http://www.declaresub.com/Articles/ReadTextFile.html>.
Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>