关于去时间段内的所有秒级时间
RT
例如:BeginTime=2012-08-03 15:00:00,EndTime=2012-08-03 16:00:00
需要获得
2012-08-03 15:00:01
2012-08-03 15:00:02
.
.
.
2012-08-03 16:00:00
放进数组,这个要咋实现?
------解决方案--------------------
        public DateTime[] GetAllSeconds(DateTime d1, DateTime d2)
       {
           List<DateTime> dList = new List<DateTime>();
           for (DateTime d = d1; d <= d2; d.AddSeconds(1))
           {
               dList.Add(d);
           }
           return dList.ToArray();
       }