1、创建一个实体类
{
public int Id { set; get; }
public string Name { set; get; }
public int Age { set; get; }
public char Gender { set; get; }
**//重写Equals方法**
public override bool Equals(object obj)
{
Student s = obj as Student;
if (this.Name == s.Name && this.Age == s.Age && this.Gender == s.Gender && this.Id == s.Id)
{
return true;
}
else
{
return false;
}
}
}
2、利用winform验证用户身份
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}