Example #1
0
 ///<summary>Adds an item to the list.</summary>
 ///<param name="Username">The username to add.</param>
 ///<param name="PassHash">The hashed password to add.</param>
 ///<exception cref="ArgumentNullException">Either Username or Password is null.</exception>
 public void AddHash(string Username, string PassHash)
 {
     if (Username == null || PassHash == null)
     {
         throw new ArgumentNullException();
     }
     if (Listing.ContainsKey(Username))
     {
         Listing[Username] = PassHash;
     }
     else
     {
         Listing.Add(Username, PassHash);
     }
 }
Example #2
0
 ///<summary>Checks whether a user/passhash combination is present in the collection or not.</summary>
 ///<param name="Username">The username to search for.</param>
 ///<param name="PassHash">The corresponding password hash to search for.</param>
 ///<returns>True when the user/passhash combination is present in the collection, false otherwise.</returns>
 public bool IsHashPresent(string Username, string PassHash)
 {
     return(Listing.ContainsKey(Username) && Listing[Username].Equals(PassHash));
 }
Example #3
0
 ///<summary>Checks whether a username is present in the collection or not.</summary>
 ///<param name="Username">The username to search for.</param>
 ///<returns>True when the username is present in the collection, false otherwise.</returns>
 public bool IsUserPresent(string Username)
 {
     return(Listing.ContainsKey(Username));
 }