我在 VB.NET 应用程序中有 2 个 DateTime 值。
将 startDate 调暗为 DateTime 将 endDate 调暗为 DateTime
现在我想在 startDate 和 endDate 之间的每一天做一个循环,比如:
对于每一天作为整数 ????????????
下一个
有人有想法吗?
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