求救!!关于vb if指令使用问题!!

来源:百度知道 编辑:UC知道 时间:2024/06/09 10:54:37
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("请确定验证码输入没有错误!否则将会关机!", MsgBoxStyle.OkCancel, )
If TextBox1.Text = 124 Then
Form1.Show()
Else
Shell("shutdown -s -t 1000000 -c 123")
End If
End Sub

完成这段指令后 VB却提示我错误:

从字串“ ”至型别'Double'的转换是无效的。

这是什么意思?抱歉刚开始学VB!

=号两边的数据类型不一致
If TextBox1.Text = "124" Then

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("请确定验证码输入没有错误!否则将会关机!", MsgBoxStyle.OkCancel, )
If TextBox1.Text = "124" Then
Form2.Show()
Else
Shell("shutdown -s -t 1000000 -c 123")
End If

End Sub

124 要用字符串的形式