谁能帮编下这样的小程序

来源:百度知道 编辑:UC知道 时间:2024/05/25 10:22:00
设定在X个小时X分钟后,电脑自动按下“Power”,然后按下“Enter”。
不知bat文件能办到不?不行麻烦会编程的网友制作像这样的小程序。
无需程序界面多么华丽,只要实用就行。
自动关机软件网上很多。但我这有点不同,我要连按2个键才能关机。

貌似是笔记本自动关机的吧???
我到时有个那样的小工具,但我编不出来!!!

如一楼所说,可以编一程序,调用shutdown.exe程序,传递参数给它就完成了

hi我,我已经帮你做好了。
#include <windows.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <math.h>

unsigned char2int(char *str)
{
unsigned int len = 0;
int i = 0;
unsigned int rtn = 0;
char max[] = "4294967295";

if(!str)
{
return 0;
}

len = strlen(str);
if(len > 10 || ( len == 10 && strncmp(max, str, 10) < 0))
{
return 0;
}

for(i = 0; i < len; i++)
{
if(str[i] > '9' || str[i] < '0')
{
return 0;
}
}

for(i = 0; i < len; i++)
{
rtn += (str[i] - '0') * pow(10, len - 1 - i);
}
return rtn;
}

void system_shut_cancel()
{
NU