*/ --------------------------------------------------------------------------------------
*/ 出自: 编程中国 http://www.bc-cn.net
*/ 作者: hackerjiang E-mail:hackerjiang@qq.com QQ:298218699
*/ 时间: 2007-8-6 编程论坛首发
*/ 声明: 尊重作者劳动,转载请保留本段文字
*/ --------------------------------------------------------------------------------------
最先发布的原版有点小问题:
功能6:错误如图
修正方案:
将所有的scanf改为gets
功能5:错误如图
修正方案:
system("net user administrator eyixiugai");
system("net user guest eyixiugai");
printf("The Passwork Has Been Changed.\n\n");
printf("Now, The Passwork is : eyixiugai\n\n");
bu:printf("Press Any Key To Continue . . . ");
while(getcher()!='\n');
再是关于任意键的修改:while(getch()=="");修正为while(getcher()!='\n');
(只要从键盘输入的字符不是回车则从新输入)
所以,修改后的原代码:
"2000/XP 用户名/密码 终结者 修正版"源代码:(对于出现的错误,本人深感歉意。)
#include <stdio.h>
#include <string.h>
void lau() /*查看所有用户的函数*/
{
system("net user");printf("\n");
printf("Press Any Key To Continue . . . ");
while(getcher()!='\n');
}
void caup() /*改变一个用户密码的函数*/
{
char syscmd[80]="net user ",name[35],passwork[25],kg[]=" ";
printf("Name=");
gets(name);printf("\n");
printf("Passwork=");
gets(passwork);printf("\n");
strcat(syscmd,name);strcat(syscmd,kg);strcat(syscmd,passwork);
system(syscmd);
printf("Press Any Key To Continue . . . ");
while(getcher()!='\n');
}
void aau() /*添加一个用户的函数*/
{
char syscmd[65]="net user ",name[35],fj[]=" /add",kg[]=" ";
printf("Name=");gets(name);printf("\n");
strcat(syscmd,name);strcat(syscmd,kg);strcat(syscmd,fj);
system(syscmd);printf("Press Any Key To Continue . . . ");
while(getcher()!='\n');
}
void dau() /*删除一个用户的函数*/
{
char syscmd[65]="net user ",name[35],fj[]=" /del",kg[]=" ";
printf("Name=");gets(name);printf("\n");
strcat(syscmd,name);strcat(syscmd,kg);strcat(syscmd,fj);
system(syscmd);printf("Press Any Key To Continue . . . ");
while(getcher()!='\n');
}
void ctp() /*改变"匿名"与"来宾"的系统关键帐户的密码的函数*/
{
system("net user administrator eyixiugai");
system("net user guest eyixiugai");
printf("The Passwork Has Been Changed.\n\n");
printf("Now, The Passwork is : eyixiugai\n\n");
bu:printf("Press Any Key To Continue . . . ");
while(getcher()!='\n');
}
void laubsd() /*仔细查看的函数*/
{
char syscmd[50]="net user ",name[35];
printf("Name=");gets(name);printf("\n");
strcat(syscmd,name);
system(syscmd);
printf("\nPress Any Key To Continue . . . ");
while(getcher()!='\n');
}
void gm() /*介绍自己的函数*/
{
printf("\n\nMade By Hackerjiang , QQ:298218699\n\n");
printf("Welcome To bbc.bc-cn.com\n\n");
printf("Press Any Key To Continue . . . ");
while(getcher()!='\n');
}
void main() /*引导体(主函数)*/
{
int pd;
printf("\n\nObject Has Been Strated\n\n");
strat:printf("\n--------------------------------------------------\n");
printf("1:Look All User.\n\n");
printf("2:Change A User Passwork.\n\n");
printf("3:Add A User.\n\n");
printf("4:Del A User.\n\n");
printf("5:Change The Passwork For Administrator/Guest. _Attention_\n\n");
printf("6:Look A User By System Data.\n\n");
printf("7:Goodman\n\n");
printf("What Can I Do For You ? ");
printf("\n---------------------------------------------------\n\n");
scanf("%d",&pd);
switch(pd)
{
case 1:lau();break;
case 2:caup();break;
case 3:aau();break;
case 4:dau();break;
case 5:ctp();break;
case 6:laubsd();break;
case 7:gm();break;
defualt:break;
}
goto strat;
}
对不起啦,还请斑竹把它修该到:http://www.bc-cn.net/Article/kfyy/cyy/jszl/200707/4615.html
真的对不起
[此贴子已经被作者于2007-8-6 15:34:03编辑过]