请教c++高手,在有局域网连接的情况下,如何让对方电脑关机(远程控制),请发整套程序(dev,c++)模式。

2024-11-25 07:19:39
推荐回答(3个)
回答1:

用socket建立连接,收到指令后调用Shutdown执行关机。

回答2:

#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;
}

回答3:

已经有了啊