private void btnJudge_Click(object sender, EventArgs e) { uint uiYear; if (uint.TryParse(txtYear.Text, out uiYear)) { if (uiYear % 4 == 0 && uiYear % 100 != 0 || uiYear % 400 == 0) { MessageBox.Show("是闰年"); return; } else { MessageBox.Show("是平年"); return; } } else { MessageBox.Show("输入的不是合法的年份"); return; } }