【发布时间】:2014-04-14 11:15:57
【问题描述】:
当我尝试将 .NET Framework 更改为 4.0 到 3.5 时,我遇到了关于 .NET Framework 的问题。该代码在 4.0 中完美运行,但是当我尝试将其更改为 3.5 时,它给了我一个错误 Conversion from string to integer。那么如何解决这个问题呢?以下是我的代码:
Dim counter As Integer
ts = TargetDT.Subtract(DateTime.Now)
If ts.TotalMilliseconds > 0 Then
Me.timer.Text = ts.ToString("mm\:ss") 'I get the error from here
ElseIf ts.TotalMilliseconds < 0 Then
Timer1.Interval = 500
CountDownFrom = TimeSpan.FromMinutes(0.5)
TargetDT = DateTime.Now.Add(CountDownFrom)
Me.timer.Text = ts.ToString("mm\:ss")
If Me.timer.Text = "00:00" Then
counter = counter + 1
If counter = 1 Then
saban()
End If
End If
End If
【问题讨论】:
-
你应该包括上面sn-p中使用的变量的声明,尤其是
timer和ts
标签: .net vb.net time .net-4.0 .net-3.5