日期:2014-05-18  浏览次数:21086 次

这段代码运行的时候出错了,一直不知道问题出在哪,望高手指点!
#region using diretives
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#endregion

namespace DeclaringConstructor
{
  public class Time
  {
  int Year;
  int Month;
  int Date;
  int Hour;
  int Minute;
  int Second;
  public void DisplayCurrenTime()
  {
  System.Console.WriteLine("{0}/{1}/{2} {3}:{4}:{5}",Month,Date,Year,Hour,Minute,Second);
  }
  public Time(System.DateTime dt)
  {
  Year=dt.Year;
  Month=dt.Month;
  Date=dt.Day;
  Hour=dt.Hour;
  Minute=dt.Minute;
  Second=dt.Second;
   
  }
  }
public class tester
{
  static void main()
  {
  System.DateTime currenTime=System.DateTime.Now;
  Time t=new Time(currentTime);
  t.DisplayCurrentTime();
  }
}
}


------解决方案--------------------
System.DateTime currenTime=System.DateTime.Now;
Time t=new Time(currentTime);

第一行是currenTime
第二行是currentTime

不一样哦,呵呵

------解决方案--------------------
探讨
改过来了还是有错,提示如下:
错误 1 程序“D:\文档\hello\hello\obj\Debug\hello.exe”不包含适合于入口点的静态“Main”方法 ahello