for (var year = new DateTime(DateTime.Now.Year - 10, 1, 1); year < new DateTime(DateTime.Now.Year + 1, 1, 1); year = year.AddYears(1)) { <option value="@year.ToString("yyyy")">@year.ToString("yyyy")</option> }
时间: 2024-10-02 08:11:46
for (var year = new DateTime(DateTime.Now.Year - 10, 1, 1); year < new DateTime(DateTime.Now.Year + 1, 1, 1); year = year.AddYears(1)) { <option value="@year.ToString("yyyy")">@year.ToString("yyyy")</option> }