public TestPassword ( string password ) : bool | ||
password | string | |
return | bool |
public bool TestPassword(string password)
{
if (!HasPassword)
return true;
return (id == Common.SHA512Str(name + password));
}
public void JoinChat(ChatRoom room, string password) { if (!room.TestPassword(password)) throw new ArgumentException("Incorrect password"); room.Password = password; JoinChat(room); }