A program written in C to make the computer shut down automatically

Updated on number 2024-03-23
7 answers
  1. Anonymous users2024-02-07

    Use cmd's timer to shut down.

    private void button1_click(object sender, eventargs e)

    if ( msg==, "shutdown -f -s -t 1");Force a one-second countdown shutdown!

    else return;

  2. Anonymous users2024-02-06

    "", "shutdown -s -t %time%");

    time is measured in seconds, and if you say a minute, you're hitting 60

    If you want to use a parameter, it's useless to have no parameter.

    s Shut down. l Logout.

    r Reboot. Then there is -t + time.

    You need to write shutdown + what you're going to do + t when you're going to do it.

  3. Anonymous users2024-02-05

    Run the following: shutdown -s -t 0 can't be closed?

  4. Anonymous users2024-02-04

    Isn't it to prevent children from being disobedient? Poor father, huh. It's really hard to do.

    If you're smart and know how to change the time in the bios, there's no way around it. Unless you use a network clock, it is when you turn on the computer, as long as your computer can access the Internet, you can get the time, and then compare and then perform the shutdown event. Of course, if he doesn't go online.

    You don't have to be so harsh either. He may be studious. Also, this program is better made as a service-oriented program.

    This way, at a higher level, he won't necessarily know how to end your program. Otherwise, the program will be stopped in the middle of the process. You're working in vain.

    It's also a good thing that you can do this kind of program for him to break. If he wants to play with the computer, he has to learn how to break your program. After a long time, he may like to compete with you, and this result may be what you want, right??

    Nothing else. I don't know much about service-oriented programs, and others might be able to help. Let's think about it before we do it.

  5. Anonymous users2024-02-03

    Let the program run on the machine, get the current time of the system after running, and then just sum"10:00"Compare, if the shutdown is performed later than this time**.

    Speaking of which, I have to say that if the user somehow changes the system time to before 10:00 before your program obtains the time, it will not be able to achieve automatic shutdown after the time is up. Personally, I think that if you want to ensure this point (that is, the user modifies the time before 10 o'clock, the program can still work normally), either add the current date, time and other detailed information in the shutdown**, and then get the time again and the saved date and time to calculate the difference.

    For example, when the computer is turned off, it is 10:00:00, and when the computer is turned on again, the time becomes ...

    This is obviously a modification of the time.,Continue to perform the shutdown**。 As for saying that if the time is changed and a new day begins, you can see what happens.

  6. Anonymous users2024-02-02

    #include ""

    #include ""

    int main()

    Call the system command, automatically shut down, delay one second Timing 1:02 shutdown, time change at will.

  7. Anonymous users2024-02-01

    It should be a mobile phone protection function, the mobile phone will automatically shut down when it reaches a certain temperature, and now the temperature is too low in winter. Apple also sometimes suffers from this problem.

Related questions
13 answers2024-03-23

Optimize your system. See if there is a knock on the shutdown in the run! If there is del >>>More

3 answers2024-03-23

For example, if your computer wants to shut down at 22:00, you can select "Start Running" and enter "at 22:00 shutdown -s", so that at 22:00, the computer will appear in the "System Shutdown" dialog box, which has a 30-second countdown by default and prompts you to save the job. >>>More

16 answers2024-03-23

Isn't it because the power management options in the desktop properties are set up for power management?

14 answers2024-03-23

This brother,Look at your configuration, I think the first thing I feel strange is your operating system,Because whether you use the popular ghost disc,Or a regular system disc,The operating system will not be:unknow unknow,This means that there is a problem with your operating system,I think the reason for your automatic shutdown of the game is also this,Automatic shutdown in addition to the protection of overheating,The system is not installed,It is also possible to cause hardware conflicts., My advice to you is to change a system disk to redo the system, if not, in consideration of other reasons, of course, in the case of no problem with the hardware, it's over!

9 answers2024-03-23

Viruses in the computer are very common, as long as you are connected to the Internet, you may be poisoned at any time! >>>More