0
我正在致力於下載ETA計算器..所以我使用Timespan代碼來告訴ETA..Visual Basic中的時間跨度代碼不能正常工作......因爲當我輸入文件大小和速度,例如1GB和1 Mb/s,Label1.Text的時間跨度爲5.17:00:00。 這裏是我的代碼時間跨度不能正常工作
Public Class Form1
Private Property z As Object
Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
Process.Start("www.speedtest.net")
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim x, y, z, a, b, c As Single
x = TextBox1.Text
y = TextBox2.Text
If RadioButton1.Checked = True And RadioButton3.Checked = True Then
Label4.Text = "Minutes"
z = x * 1024
c = y/8
a = z/c
Label1.Text = New TimeSpan(a/60, 0, 0).ToString()
End If
If RadioButton1.Checked = True And RadioButton4.Checked = True Then
Label4.Text = "Minutes"
z = x * 1024
c = 1024/8/y
a = z/c
Label1.Text = New TimeSpan(a/60, 0, 0).ToString()
End If
If RadioButton2.Checked = True And RadioButton3.Checked = True Then
Label4.Text = "Hours"
z = x * 1048576
c = y/8
a = z/c
b = a/60
Label1.Text = New TimeSpan(a/60, 0, 0).ToString()
End If
If RadioButton2.Checked = True And RadioButton4.Checked = True Then
Label4.Text = "Hours"
z = x * 1048576
c = 1024/8 * y
a = z/c
b = a/60
Label1.Text = New TimeSpan(a/60, 0, 0).ToString()
End If
End Sub
Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.CheckedChanged
End Sub
Private Sub Button2_Click_1(sender As Object, e As EventArgs) Handles Button2.Click
MsgBox("Made by SldCvr Enterprises", MsgBoxStyle.OkOnly, "About")
End Sub
末級
這裏是設計師
http://i.stack.imgur.com/f3pFm.jpg
'Option Strict On'和'Option Infer Off'可能會很痛苦,但在這種情況下,它會顯示OP出錯的地方,不是嗎? – hometoast
可能,但我是一個C#開發人員,所以我不知道;) – woutervs
這可能工作.. – SldCvr