自动 重新启动机器的程序。。 
 不太懂api 函数 谁能帮忙写一个啊

解决方案 »

  1.   

    添加这个模块到工程:http://www.m5home.com/bbs/dispbbs.asp?boardid=28&Id=391&page=3然后这样调用:Call ShutDownPC(2)   '重启测试时注意保存工程....
      

  2.   

    你是重新启动什么机器   下面是重新启动系统Private Sub Command1_Click()
    Shell "shutdown -r -t 0 -f" '-r 是重启 等待时间为0秒
    End Sub
      

  3.   

    window API ExitWindow()'In   general   section   
      Const   EWX_LOGOFF   =   0   
      Const   EWX_SHUTDOWN   =   1   
      Const   EWX_REBOOT   =   2   
      Const   EWX_FORCE   =   4   
      Private   Declare   Function   ExitWindowsEx   Lib   "user32"   (ByVal   uFlags   As   Long,   ByVal   dwReserved   As   Long)   As   Long   
      Private   Sub   Form_Load()   
              msg   =   MsgBox("This   program   is   going   to   reboot   your   computer.   Press   OK   to   continue   or   Cancel   to   stop.",   vbCritical   +   vbOKCancel   +   256,   App.Title)   
              If   msg   =   vbCancel   Then   End   
              'reboot   the   computer   
              ret&   =   ExitWindowsEx(EWX_FORCE   Or   EWX_REBOOT,   0)   
      End   Sub