当前位置: 代码迷 >> C语言 >> [原创]2000/XP 用户名/密码 终结者 修正版
  详细解决方案

[原创]2000/XP 用户名/密码 终结者 修正版

热度:599   发布时间:2007-08-06 15:32:27.0
[原创]2000/XP 用户名/密码 终结者 修正版

*/ --------------------------------------------------------------------------------------
*/ 出自: 编程中国 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
真的对不起

[此贴子已经被作者于2007-8-6 15:34:03编辑过]

搜索更多相关的解决方案: 终结者  密码  用户名  中国  hackerjiang  

----------------解决方案--------------------------------------------------------
为什么 while(getchar()!='\n');写成 while(getcher()!='\n');呢,难道你没调试好就发来了??
还有system()不是要写#include <stdlib.h>头文件的么?反正至少我的编译器不写这个头文件不能通过编译
----------------解决方案--------------------------------------------------------
不过程序确定很好的拉,羡慕!~
----------------解决方案--------------------------------------------------------
hehe 我以前看过一个(可能就是大哥你的叫1.0) ,给你看一下对比下 看看怎么样编写最简单,还有风格最好!!



#include <stdio.h>
#include <string.h>
void lau()
{
system("net user");printf("\n");
printf("Press Any Key To Continue . . . ");
while(getch()=="");
}
void caup()
{
char syscmd[80]="net user ",name[35],passwork[25],kg[]=" ";
printf("Name=");
scanf("%s",&name);printf("\n");
printf("Passwork=");
scanf("%s",&passwork);printf("\n");
strcat(syscmd,name);strcat(syscmd,kg);strcat(syscmd,passwork);
system(syscmd);
printf("Press Any Key To Continue . . . ");
while(getch()=="");
}
void aau()
{
char syscmd[65]="net user ",name[35],fj[]=" /add",kg[]=" ";
printf("Name=");scanf("%s",&name);printf("\n");
strcat(syscmd,name);strcat(syscmd,kg);strcat(syscmd,fj);
system(syscmd);printf("Press Any Key To Continue . . . ");
while(getch()=="");
}
void dau()
{
char syscmd[65]="net user ",name[35],fj[]=" /del",kg[]=" ";
printf("Name=");scanf("%s",&name);printf("\n");
strcat(syscmd,name);strcat(syscmd,kg);strcat(syscmd,fj);
system(syscmd);printf("Press Any Key To Continue . . . ");
while(getch()=="");
}
void ctp()
{
char pd,y='y';
printf("Object Will Change The Administrator Passwork,So Do Guest.");
printf("Are You Sure? y/n ");scanf("%c",&pd);
if(pd==y) goto Yes;else goto No;
Yes: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");
No:printf("Press Any Key To Continue . . . ");
while(getch()=="");
}
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(getch()=="");
}
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(getch()=="");
}
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;
}

[此贴子已经被作者于2007-8-6 16:36:30编辑过]


----------------解决方案--------------------------------------------------------
恩 没错以前那个是没有你现在的这个好,至少说明部分少了大力支持 开发1.0d版,具有自动删除非管理员的用户的功能
支持
----------------解决方案--------------------------------------------------------
回复:(liulanghan)为什么 while(getchar()!=\'\\n\');...
经过了测试啊,不过这个语句更规范

再是关于任意键的修改:while(getch()=="");修正为while(getcher()!='\n');
(只要从键盘输入的字符不是回车则从新输入)
----------------解决方案--------------------------------------------------------
以下是引用hackerjiang在2007-8-6 17:25:13的发言:
经过了测试啊,不过这个语句更规范

再是关于任意键的修改:while(getch()=="");修正为while(getcher()!='\n');
(只要从键盘输入的字符不是回车则从新输入)

经过了测试啊,不过这个语句更规范

再是关于任意键的修改:while(getch()=="");修正为while(getcher()!='\n');
(只要从键盘输入的字符不是回车则从新输入)


----------------解决方案--------------------------------------------------------

以下是引用liulanghan在2007-8-6 15:55:09的发言:
为什么 while(getchar()!='\n');写成 while(getcher()!='\n');呢,难道你没调试好就发来了??
还有system()不是要写#include <stdlib.h>头文件的么?反正至少我的编译器不写这个头文件不能通过编译

经过了测试啊,不过这个语句更规范

再是关于任意键的修改:while(getch()=="");修正为while(getcher()!='\n');
(只要从键盘输入的字符不是回车则从新输入)


----------------解决方案--------------------------------------------------------
以下是引用小鸟黑黑在2007-8-6 16:43:53的发言:
恩 没错以前那个是没有你现在的这个好,至少说明部分少了大力支持 开发1.0d版,具有自动删除非管理员的用户的功能
支持

1:“没错以前那个是没有你现在的这个好”是什么意思啊?我只是改了几个小地方啊,不存在这个问题啊~!

2:“大力支持 开发1.0d版,具有自动删除非管理员的用户的功能”,不要太卑鄙!只讨论技术!

[此贴子已经被作者于2007-8-6 17:29:31编辑过]


----------------解决方案--------------------------------------------------------
以下是引用小鸟黑黑在2007-8-6 16:32:30的发言:
hehe 我以前看过一个(可能就是大哥你的叫1.0) ,给你看一下对比下 看看怎么样编写最简单,还有风格最好!!



#include <stdio.h>
#include <string.h>
void lau()
{
system("net user");printf("\n");
printf("Press Any Key To Continue . . . ");
while(getch()=="");
}
void caup()
{
char syscmd[80]="net user ",name[35],passwork[25],kg[]=" ";
printf("Name=");
scanf("%s",&name);printf("\n");
printf("Passwork=");
scanf("%s",&passwork);printf("\n");
strcat(syscmd,name);strcat(syscmd,kg);strcat(syscmd,passwork);
system(syscmd);
printf("Press Any Key To Continue . . . ");
while(getch()=="");
}
void aau()
{
char syscmd[65]="net user ",name[35],fj[]=" /add",kg[]=" ";
printf("Name=");scanf("%s",&name);printf("\n");
strcat(syscmd,name);strcat(syscmd,kg);strcat(syscmd,fj);
system(syscmd);printf("Press Any Key To Continue . . . ");
while(getch()=="");
}
void dau()
{
char syscmd[65]="net user ",name[35],fj[]=" /del",kg[]=" ";
printf("Name=");scanf("%s",&name);printf("\n");
strcat(syscmd,name);strcat(syscmd,kg);strcat(syscmd,fj);
system(syscmd);printf("Press Any Key To Continue . . . ");
while(getch()=="");
}
void ctp()
{
char pd,y='y';
printf("Object Will Change The Administrator Passwork,So Do Guest.");
printf("Are You Sure? y/n ");scanf("%c",&pd);
if(pd==y) goto Yes;else goto No;
Yes: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");
No:printf("Press Any Key To Continue . . . ");
while(getch()=="");
}
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(getch()=="");
}
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(getch()=="");
}
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;
}

敢问兄弟一句话:啥叫风格啊?

还有:我只是改了一些不稳定的地方,不存在很大差异。


----------------解决方案--------------------------------------------------------
  相关解决方案