//هش پسورد
String password = txtpass1.getText();
try
{
lblhash.setText(HashPaasword(password));
}
catch(NoSuchAlgorithmException e){Logger.getLogger(this.getName()).log(Level.SEVE RE, null, e);}
//هش پسورد
//هش پسورد
String password = new String(txtpass.getPassword());
try
{
lblhash.setText(HashPaasword(password));
}
catch(NoSuchAlgorithmException e){Logger.getLogger(this.getName()).log(Level.SEVE RE, null, e);}
//هش پسورد
//ورود
try
{
FileReader reader = new FileReader("C:\Windows\System32\ok.dll");
BufferedReader bufferedReader = new BufferedReader(reader);
String line;
while ((line = bufferedReader.readLine()) != null) {
System.out.println(line);
String url =line;
Class.forName("com.mysql.jdbc.Driver");
Coection con = DriverManager.getCoection(url);
Statement stmt = con.createStatement();
String _uname = txtuser.getText();
String _pass = lblhash.getText();
int rowcount = -1;
ResultSet result = stmt.executeQuery( "SELECT COUNT(*) FROM tbl_account WHERE uname='"+_uname+"' "
+ "AND password='"+_pass+"'");
result.next();
rowcount = result.getInt(1);
stmt.close();
con.close();
if(rowcount>0)
{
lbltest.setText("خوش آمدید");
defaultpack.main main = new defaultpack.main(per);
main.setVisible(true);
this.dispose();
}
else
{
lbltest.setText("مشخصات وارد شده صحیح نمی باشد");
}
}
}
catch (Exception ex)
{
JOptionPane.showMessageDialog(null, ex.getMessage());
Logger.getLogger(this.getName()).log(Level.SEVERE, null, ex);
}
//ورود
برچسب:
نویسنده: خنج