vb.net 如何根据星期取日期,在线等
我想让textbox默认 本周星期1的年月日。 怎么实现?
[解决办法]
Dim xN As Int16
xN = 1 - Weekday(Today, FirstDayOfWeek.Monday)
TextBox1.Text = DateAdd(DateInterval.Day, xN, Today)
[解决办法]
Dim i As Integer
i = 1 - Today.DayOfWeek 'Today.DayOfWeek=本周的第几天
TextBox1.Text = Today.AddDays(i).ToShortDateString()