如何用vb实现电脑一天只允许开机150分钟的程序,无论是重起,还是多系统,都能实现,每天只能开机150分钟,而且开机制动加载

解决方案 »

  1.   

    试试看这个
    新建一个工程,将在窗体上增加一个Timer控件,并将其执行间隔设置为60000
    dim count as integer
    private sub  form_load()
      on error resume next
      open "count.txt" for input as #1
      input #1,cout
      close #1
      me.show
      me.hide
    end subprivate sub timer1_timer()
      cout=cout+1
      if cout>=150 then 
          msgbox "Time is over 150m...":
          shell "shutdown.exe -s" ' when you system is winXP,shutdown you computer
      end if
      open "count.txt" for output as #1
      print #1,cout
      close #1
    end sub
      

  2.   

    最上一行应该是:dim cout as integer
    然后你将该程序编译后加入到系统的“启动”项中。
      

  3.   

    最好将数据写入硬盘的保留扇区,这个要用其他语言写成dll或vxd,然后用vb调用
      

  4.   

    无论是重起,还是多系统,都能实现
                AAAAAAAAAA
    假如别人用DOS怎么办?VB程序只能在Win32平台下运行
      

  5.   

    我说得多系统指的事windows os系列,没有什么dos,linux,等其他乱七八糟的东西
      

  6.   

    Option Explicit
    Dim I As Integer
    Dim intmin As Integer
    Private Sub Command1_Click()
    intmin = Text1.Text
    If intmin > 300 Then
    MsgBox "你设置的时间太长,系统不允许!"
    intmin = 150
    End If
    Form1.HideEnd SubPrivate Sub Form_Load()
     On Error Resume Next
      Open "d:\usepc.txt" For Input As #1
      Input #1, I
      Close #1
      If I = 0 Then
      Me.Show  Else
      Me.Hide
    End IfEnd SubPrivate Sub Timer1_Timer()
    I = I + 1
      If I >= intmin Then
          MsgBox "Time is over " & intmin & "150m...":
          
          Shell "shutdown.exe -s" ' when you system is winXP,shutdown you computer
      End If
      Open "count.txt" For Output As #1
      Print #1, I
      Close #1End Sub
    但是如果写入注册表是不是好一点,而且这样好象只要有一次,以后接开不料机了,
      

  7.   

    查找所有的win.ini文件,都加上条"load=你的程序",然后在你的程序运行时在加入注册表不就行了.
      

  8.   

    只要是能够接触计算机就能关闭你的应用程序
    为什么?因为你用的是Windows
    别人可以进DOS Kill你的EXE,就算你的程序再NB也没办法
    现在光盘版的Windows到处都是,只要能够CD-ROM启动还管你是什么操作系统