主题:[讨论]新手请教代码问题
[em1]自学了一段时间的VB,终于自己能写个用的着的小程序了!心里很高兴[em8]!
自动关机的,写的很粗糙,运行后占2M的内存!我想问下我这代码是不是有问题,这么写有哪些缺点
Dim t As String
Dim a As String
Dim b As String
Private Sub Command1_Click()
a = Combo4 & "-" & Combo3 & "-" & Combo2 & " " & Combo1 & ":" & Combo5 & ":" & Combo6
Print a
Text1.Text = Combo4 & "-" & Combo3 & "-" & Combo2 & " " & Combo1 & ":" & Combo5 & ":" & Combo6
End Sub
Private Sub Timer1_Timer()
t = Now()
Form1.Caption = t
Label1.Caption = t
b = Text1.Text
If t = b Then
Shell "shutdown -S -t 6"
End If
End Sub
自动关机的,写的很粗糙,运行后占2M的内存!我想问下我这代码是不是有问题,这么写有哪些缺点
Dim t As String
Dim a As String
Dim b As String
Private Sub Command1_Click()
a = Combo4 & "-" & Combo3 & "-" & Combo2 & " " & Combo1 & ":" & Combo5 & ":" & Combo6
Print a
Text1.Text = Combo4 & "-" & Combo3 & "-" & Combo2 & " " & Combo1 & ":" & Combo5 & ":" & Combo6
End Sub
Private Sub Timer1_Timer()
t = Now()
Form1.Caption = t
Label1.Caption = t
b = Text1.Text
If t = b Then
Shell "shutdown -S -t 6"
End If
End Sub