从零开始学ASP.NET(基础篇)(6) try { DateTime dt = new DateTime(year, month, date); } catch { labCheckInfo.Text = "输入的数字不符合日期格式"; return; }