我在VB.NET应用程序中有2个DateTime值。datetime range vb.net for loop
昏暗的startDate为DATETIME 昏暗的结束日期为DATETIME
现在我想为的startDate和结束日期之间一样,每天一个循环:
对于每一天都当作整数??????? ???
Next
有人有想法吗?
我在VB.NET应用程序中有2个DateTime值。datetime range vb.net for loop
昏暗的startDate为DATETIME 昏暗的结束日期为DATETIME
现在我想为的startDate和结束日期之间一样,每天一个循环:
对于每一天都当作整数??????? ???
Next
有人有想法吗?
C#:
for(DateTime CurrentDate = StartDate;
CurrentDate < EndDate;
CurrentDate = CurrentDate.AddDays(1))
{
}
VB.NET:
Dim CurrentDate As DateTime = StartDate
While CurrentDate < EndDate
CurrentDate = CurrentDate.AddDays(1)
End While
Dim currentDate As Date = startDate
While currentDate <= endDate
'do something with this date...'
currentDate = currentDate.AddDays(1)
End While
如果你发现自己的解决问题的办法,那么请张贴作为一个答案,并接受它作为正确的答案(你不会收到任何代表,因此这很好)。这样其他人也可以从中受益。 – 2011-01-26 08:38:03