VB问题,十万火急~菜鸟求帮助,高手速来助!谢谢~拒绝沙发!

来源:百度知道 编辑:UC知道 时间:2024/05/31 21:52:05
我做了一个自动关机的代码,但怕它不设置时间导致直接关机,所以把:
Private Sub enter_Click()
Dim h As Integer, m As Integer, s As Integer
h = t1.Text
m = t2.Text
s = t3.Text
Shell "shutdown -s -f -t " & h * 3600 + m * 60 + s
End Sub
这段代码加成了:
Private Sub enter_Click()
Dim h As Integer, m As Integer, s As Integer
h = t1.Text
m = t2.Text
s = t3.Text
if h+m+s>1 then
Shell "shutdown -s -f -t " & h * 3600 + m * 60 + s
else
beep
magbox "请输入数据!“
--------------------------------
却显示我没定义~怎么办

这样改。
=============
Private Sub enter_Click()
Dim h As Integer, m As Integer, s As Integer
h = t1.Text
m = t2.Text
s = t3.Text
if h+m+s>1 then
Shell "shutdown -s -f -t " & h * 3600 + m * 60 + s
else
beep
msgbox "请输入数据!" '看看你的拼写错误,另外引号之能是"而不能是“
end if '必须有这一句.