我想使用 VB.Net 获得一年中的总小时数。是否有任何方法或功能可以帮助我们实现这一目标?
我想得到类似的东西:
Private Function GetTotalHours(ByVal year As String) As String
Dim time As String = String.Empty
Try
' Calculate here...
Catch ex As Exception
End Try
Return time
End Function
并像这样使用它:
TextBox1.Text = GetTotalHours('2008') ' Result will be = 8784
TextBox1.Text = GetTotalHours('2013') ' Result will be = 8760