首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

这段代码运行的时候出错了,一直不知道有关问题出在哪,望

2012-08-10 
这段代码运行的时候出错了,一直不知道问题出在哪,望高手指点!#region using diretivesusing Systemusing

这段代码运行的时候出错了,一直不知道问题出在哪,望高手指点!
#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

热点排行