///<summary> /// Returns the entry for the supplied username or null if an /// invalid username is given. ///</summary> public LastLogEntry GetLlName(string name) { Password pw = new Password(); LastLogEntry llent = (LastLogEntry)null; PasswordEntry pwent = pw.GetPWName(name); if (pwent != null) { llent = this.GetLlUid(pwent.Uid); } return(llent); }
///<summary> /// Return the PasswordEntry for the entry that matches the user id /// Will return null if no matching entry is found. ///</summary> public PasswordEntry GetPWUid(int Uid) { long pos = fs.Position; this.SetPWEnt(); PasswordEntry pwent = (PasswordEntry)null; while ((pwent = this.GetPWEnt()) != null) { if (pwent.Uid == Uid) { break; } } fs.Seek(pos, SeekOrigin.Begin); return(pwent); }
///<summary> /// Return the PasswordEntry for the entry that matches the user name /// Will return null if no matching entry is found. ///</summary> public PasswordEntry GetPWName(string Name) { long pos = fs.Position; this.SetPWEnt(); PasswordEntry pwent = (PasswordEntry)null; while ((pwent = this.GetPWEnt()) != null) { if (pwent.Name == Name) { break; } } fs.Seek(pos, SeekOrigin.Begin); return(pwent); }