将输入时间格式化为“yyyy-MM-DD“
string str3;
try
{
System.DateTime.Parse(str3.Substring(0,4)+"-"+str3.Substring(4,2)+"-"+str3.Substring(6,2));
}
catch (Exception)
{
MessageBox.Show("日期输入格式不正确!","出错了");
return;
}
string str3;
try
{
System.DateTime.Parse(str3.Substring(0,4)+"-"+str3.Substring(4,2)+"-"+str3.Substring(6,2));
}
catch (Exception)
{
MessageBox.Show("日期输入格式不正确!","出错了");
return;
}