Hey Leute
Wo liegt bei dem Code der Fehler:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If My.Computer.Clock.LocalTime.DayOfWeek = DayOfWeek.Tuesday Then
MsgBox("Today is Tuesday")
End If
If My.Computer.Clock.LocalTime.DayOfWeek = DayOfWeek.Wednesday Then
MsgBox("Today is Wednesday")
End If
If My.Computer.Clock.LocalTime.DayOfWeek = DayOfWeek.Thursday Then
MsgBox("Today is Thursday")
End If
If My.Computer.Clock.LocalTime.DayOfWeek = DayOfWeek.Friday Then
MsgBox("Weekend incoming")
End If
If My.Computer.Clock.LocalTime.DayOfWeek = DayOfWeek.Saturday Then
MsgBox("Weekend")
End If
If My.Computer.Clock.LocalTime.DayOfWeek = DayOfWeek.Sunday Then
MsgBox("Weekend bald vorbei")
End If
End Sub
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Ich erhalte den Fehler: Die Anweisung ist in einem Namespace ungültig.
Was ist falsch ?
Wo liegt bei dem Code der Fehler:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If My.Computer.Clock.LocalTime.DayOfWeek = DayOfWeek.Tuesday Then
MsgBox("Today is Tuesday")
End If
If My.Computer.Clock.LocalTime.DayOfWeek = DayOfWeek.Wednesday Then
MsgBox("Today is Wednesday")
End If
If My.Computer.Clock.LocalTime.DayOfWeek = DayOfWeek.Thursday Then
MsgBox("Today is Thursday")
End If
If My.Computer.Clock.LocalTime.DayOfWeek = DayOfWeek.Friday Then
MsgBox("Weekend incoming")
End If
If My.Computer.Clock.LocalTime.DayOfWeek = DayOfWeek.Saturday Then
MsgBox("Weekend")
End If
If My.Computer.Clock.LocalTime.DayOfWeek = DayOfWeek.Sunday Then
MsgBox("Weekend bald vorbei")
End If
End Sub
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Ich erhalte den Fehler: Die Anweisung ist in einem Namespace ungültig.
Was ist falsch ?
Zuletzt bearbeitet: