嗨,任何人都可以帮我解决这个错误,我现在已经坐了一个小时,但不知道如何解决这个错误,我的代码是
'Calculate the total of hours worked
'Declare a Date Time Variable
Dim TempDateTime As DateTime = Nothing
'Declare a local time span variable
Dim TempTimeSpan As New TimeSpan
'Declare a array of type string and set the size equal to number of text boxes.
Dim arr(6) As String
'set the value for text boxs to array
arr(0) = lblmontotal.Text
arr(1) = lbltuestotal.Text
arr(2) = lblwedtotal.Text
arr(3) = lblthurstotal.Text
arr(4) = lblfridtotal.Text
For i As Integer = 0 To arr.Length - 1
TempDateTime = CDate(arr(i))
TempTimeSpan = TempTimeSpan.Add(New TimeSpan(TempDateTime.Hour, TempDateTime.Minute, 0))
Next
'showing the total time.
lbltotalhours.Text = (TempTimeSpan.Hours & ":" & TempTimeSpan.Minutes)