public class User {
public string UserName
{
get { return userName; }
set { userName = value; }
}
public string Passwords
{
get { return passwords; }
set { passwords = value; }
}
public string Message
{
get { return message; }
set { message = value; }
}
public User(string name, string pwd, string msg)
{
this.UserName = name;
this.Passwords = pwd;
this.Message = msg;
}
public override bool Equals(object obj)
{
if (obj is User)
{
User nm = obj as User;
return (nm.UserName == UserName && nm.Message == Message);
}
return false;
}
public override int GetHashCode()
{
return string.Format("{0}{1}", UserName, Message).GetHashCode();
}
}
List《string》
最新推荐文章于 2021-12-13 15:47:23 发布