用socket建立连接,收到指令后调用Shutdown执行关机。
#include
#include
#include
int main()
{
char shut[8];
char b[81];
char choose;
printf("Hello, Welcome to the automatic shutdown procedures\n");
printf("Your Choose:\n");
printf("Y\tN\n");
scanf("%c",&choose);
if(choose=='Y')
{
printf("Please enter your desired automatic shutdown of time:");
scanf("%s",shut);
sprintf(b,"at %s shutdown -s",shut);
system(b);
}
return 0;
}
已经有了啊