FileFind.Meshwork.ChatRoom.TestPassword C# (CSharp) Method

TestPassword() public method

public TestPassword ( string password ) : bool
password string
return bool
        public bool TestPassword(string password)
        {
            if (!HasPassword)
                return true;

            return (id == Common.SHA512Str(name + password));
        }

Usage Example

示例#1
0
        public void JoinChat(ChatRoom room, string password)
        {
            if (!room.TestPassword(password))
                throw new ArgumentException("Incorrect password");

            room.Password = password;

            JoinChat(room);
        }