當前位置:編程學習大全網 - 網站源碼 - VB快速關機源代碼

VB快速關機源代碼

在公***標準模塊中聲明WIN API:

Public Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long

在按鈕事件中用如下代碼可關機:

Private Sub Command1_Click()

ExitWindowsEx 1, 0

End Sub

在按鈕事件中用如下代碼可重啟:

Private Sub Command1_Click()

ExitWindowsEx 2, 0

End Sub

上述代碼在WIN9X系統未見問題,在WIN2000不能實現。WINXP有些版本無問題。

以下是“逍遙忘我”網友的答復:

Shell "shutdown.exe -s -f -t 0",vbhide

  • 上一篇:clv4和clu4的區別是什麽?期貨和現貨嗎?哪個是期貨哪個是現貨?
  • 下一篇:VIP音樂源代碼
  • copyright 2024編程學習大全網