第1个回答 2022-10-12
Public Class Form1
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim d1 As Date
Dim strweekday As String
strweekday = WeekdayName(Weekday(d1))
d1 = Today
Dim year1, month1, day1 As String
year1 = Year(d1)
month1 = Month(d1)
day1 = Microsoft.VisualBasic.Day(d1)
If Weekday(d1) > 1 And Weekday(d1) < 6 Then
Label1.Text = year1 & "/" & month1 & "/" & day1 & strweekday & " 工作日"
Else : Label1.Text = "休息日"
End If
End Sub