如標題

解决方案 »

  1.   

    转换为DateTime,看是否抛出异常,
      

  2.   

    private bool date()
            {
                string str = "2010.1.1";
                try
                {
                    DateTime date = Convert.ToDateTime(str);
                    return true;
                }
                catch (Exception ee)
                {
                    return false;
                }
            } private void button_Click(object sender, EventArgs e)
            {
                MessageBox.Show(date().ToString());
            }
      

  3.   


                try
                {
                    Convert.ToDateTime(strDate);//strDate你的字符串
                }
                catch(Exception ex)
                {
                    MessageBox.Show("不能转换");
                    return;
                }