熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

用VB.NET 2005編寫定時關機程序[3]

2022-06-13   來源: .NET編程 

  雙擊注銷button按鈕輸入code:

Private Sub Button_Click(ByVal sender As SystemObject ByVal e As SystemEventArgs) Handles ButtonClick
LogoOff()注銷計算機
End Sub
  雙擊重新啟動按鈕button輸入code:

Private Sub Button_Click(ByVal sender As SystemObject ByVal e As SystemEventArgs) Handles ButtonClick

Reboot()

End Sub
  雙擊關閉計算機按鈕button輸入code:

Private Sub Button_Click(ByVal sender As SystemObject ByVal e As SystemEventArgs) Handles ButtonClick
 startTime = TimeOfDay
 If Not IsDate(TextBoxText) Then
  用IsData函數判斷輸入的時間格式
  MsgBox(你所輸入的不是時間格式! 錯誤)
 Else
  entTime = TimeValue(TextBoxText)
 End If
 TimerEnabled = True
 啟動定時器
 MeWindowState = SystemWindowsFormsFormWindowStateMinimized
 最小化窗體

End Sub
  如圖

點擊放大此圖片
  雙擊timer控件如圖

                                      

點擊放大此圖片

[]  []  []  []  


From:http://tw.wingwit.com/Article/program/net/201311/15694.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.