一、C++ ATM机修改密码功能求修改代码.
先小批评一下LZ,自己写的东西要自己明白,不要写了后面忘了前面》 错在函数void ATM::change_password()的: if(!check_password(ctm.get_password(),pwd)) 应改为if(!check_password(ctm.get_num(),pwd))或其他类似东东,总之就是实参和形数不符。
:RT #include " " 个人觉得这段代码存在问题 不符合楼主的要求 应该是代码解释 type="text" 这是一个文本框 输入的东西都是明文现实 所以大家可以看到 请输入密码 当有人单击时 则会调用 change_type(this) 这个函数 参数就是input本身 change_type() 函数内容如下 function change_type(g_type){ g_type.type = "password"} 个人的思路 未作任何测试 有问题的话跟帖 我会修正。 先小批评一下LZ,自己写的东西要自己明白,不要写了后面忘了前面》 错在函数void ATM::change_password()的: if(!check_password(ctm.get_password(),pwd)) 应改为if(!check_password(ctm.get_num(),pwd))或其他类似东东,总之就是实参和形数不符。 :RT #include #include using namespace std; class customer { public: friend class ATM; customer(char Name[],char Num[],float Money,char Password[]); //初始化 protected: char * get_name(); //返回姓名 char * get_num(); //返回卡号 char * get_password(); //返回密码 float get_money(); //返回金额 void set_password(char pwd[]); //设置密码 void set_money(float m); //取钱 private: char password[6]; //用户密码 char name[20]; //用户姓名 char num[20]; float money; }; class ATM { public: ATM(customer & cn):ctm(cn){} void welcome(); //登陆界面 bool check_password(char p[],char pwd[]); //核对密码 void change_password(); //修改密码 void get_money(); //取钱 void get_information(); //查询信息 void exit_ATM(); //退出ATM void show_function(); //功能界面 void push_card(); //吞卡 private: int times; //记录输入密码的次数 customer & ctm; }; //构造ATM的函数 void ATM::welcome() //构造welcome { times=0; cout char pwd[7],num[20]; //6位密码19位卡号 int i=0; do { cout cin>>num; cout cin>>pwd; if(!check_password(num,pwd)) { cout times++; } else { show_function(); } }while(times push_card(); } bool ATM::check_password(char num[],char pwd[]) //构造核对密码 { if(strcmp(num,ctm.get_num())==0&&strcmp(pwd,ctm.get_password())==0) return true; else return false; } void ATM::show_function() //构造功能界面 { int n; do { cout cout cout cout cout cin>>n; while(n>4) { cout cout cin>>n; } switch(n) { case 1:change_password(); break; case 2:get_money(); break; case 3:get_information(); break; case 4:exit_ATM(); break; } }while(true); } void ATM::change_password() //构造修改密码 { char pwd[7],repwd[7]; times=0; do { cout cin>>pwd; //if(!check_password(ctm.get_password(),pwd)) if(!check_password(ctm.get_num(),pwd)) times++; else break; }while(times if(times==2) push_card(); int m=0; do { cout cin>>pwd; cout cin>>repwd; if((m=strcmp(pwd,repwd))!=0) cout}while(m!=0); ctm.set_password(pwd); cout} void ATM::get_money() //构造取钱 { float m; char ch; do { cout cin>>m; while(m{ cout cin>>m; } if(ctm.get_money()-m{ cout} else { ctm.set_money(m); cout cin>>ch; while(ch!='n'&&ch!='N'&&ch!='y'&&ch!='Y') { cout cout cin>>ch; } } }while(ch=='y'||ch=='Y'); } void ATM::get_information() //构造查询信息 { cout cout cout cout cout} void ATM::push_card() //构造吞卡 { cout cout exit(1); } void ATM::exit_ATM() //构造退出ATM { cout cout exit(0); } customer::customer(char Name[],char Num[],float Money,char Password[]) //构造初始化 { strcpy(name,Name); strcpy(num,Num); money=Money; strcpy(password,Password); } float customer::get_money() //构造返回金额 { return money; } char *customer::get_name() //构造返回用户名 { return name; } char *customer::get_num() //构造返回卡号 { return num; } char *customer::get_password() //构造返密码 { return password; } void customer::set_password(char pwd[]) //构造修改密码 { strcpy(password,pwd); } void customer::set_money(float m) { money-=m; } int main() //主函数 { customer ctm("wangwei","0001",1000000,"123"); //创建对象 调用初始化 ATM atm(ctm); atm.welcome(); //主程序调用开始 }。 加密一个未加密的数据库或者更改一个加密数据库的密码,打开数据库,启动SQLiteConnection的ChangePassword() 函数 // Opens an unencrypted database SQLiteConnection cnn = newSQLiteConnection("Data Source=c:\\test.db3"); cnn.Open(); // Encrypts the database. The connection remains valid and usable afterwards. cnn.ChangePassword("mypassword"); 解密一个已加密的数据库调用l ChangePassword() 将参数设为 NULL or "" : // Opens an encrypted database SQLiteConnection cnn = newSQLiteConnection("Data Source=c:\\test.db3;Password=mypassword"); cnn.Open(); // Removes the encryption on an encrypted database. cnn.ChangePassword(""); 要打开一个已加密的数据库或者新建一个加密数据库,在打开或者新建前调用SetPassword()函数 // Opens an encrypted database by calling SetPassword() SQLiteConnection cnn = newSQLiteConnection("Data Source=c:\\test.db3"); cnn.SetPassword(newbyte[] { 0xFF, 0xEE, 0xDD, 0x10, 0x20, 0x30 }); cnn.Open(); // The connection is now usable Sqlite数据库的加密 1、创建空的sqlite数据库。 //数据库名的后缀你可以直接指定,甚至没有后缀都可以 //方法一:创建一个空sqlite数据库,用IO的方式 FileStream fs = File.Create(“c:\\test.db“); //方法二:用SQLiteConnection SQLiteConnection.CreateFile(“c:\\test.db“); 创建的数据库是个0字节的文件。 2、创建加密的空sqlite数据库 //创建一个密码为password的空的sqlite数据库 SQLiteConnection.CreateFile(“c:\\test2.db“); SQLiteConnection cnn = new SQLiteConnection(“Data Source=c:\\test2.db“); SQLiteConnection cnn = new SQLiteConnection(“Data Source=D:\\test2.db“); cnn.Open(); cnn.ChangePassword(“password“); 个人觉得这段代码存在问题 不符合楼主的要求 <input type="text" value="请输入密码" style="width:100px;height:20px" name="jpassword" onclick="a()"> <input type="password" style="width:100px;height:20px;display:none;" name="password"> 应该是<input type="text" style="width:100px;height:20px;display:none;" name="password" ID="password" value="请输入密码" onclick="change_type(this)" />;代码解释 type="text" 这是一个文本框 输入的东西都是明文现实 所以大家可以看到 请输入密码 当有人单击时 则会调用 change_type(this) 这个函数 参数就是input本身 change_type() 函数内容如下 function change_type(g_type){ g_type.type = "password"} 个人的思路 未作任何测试 有问题的话跟帖 我会修正 代码未经任何整理 楼主需要重新整理下 才可以使用 尝试以下方法: Manual remove password VBS 1. Open file in WinHex 2. In the end the file has such appearance: 00 00 00 01 00 00 00 00 00 00 06 00 00 00 73 5E 52 57 5E 16 (这串数字可能不同) 735E52575E16 - The coded password 06 - Number of symbols in the password 01 - Attribute of presence of the password We change 01 on 00 and the script can be opened 破解C脚本: 1.首先新建一个空的无密码脚本 2.ULTRAEDIT32打开两个脚本(一个有密码,一个没有密码) 3.从没有密码的脚本中的函数名一开始一直选中到04前(是复制到十六进制的第一个04之前),用复制的内容覆盖需要破解的脚本相应部分,然后存盘即可。 转载请注明出处51数据库 » changepassword函数二、表单中password元素的明文显示
三、C++ ATM机修改密码功能求修改代码.
四、数据库怎么查询未加密的存量数据
五、表单中password元素的明文显示
六、wincc c脚本函数如何解密