protected void Page_Load(object sender, EventArgs e) { string a = TextBox1.Text; string b = TextBox2.Text; MultipurposeMultiplexingClass warning = new MultipurposeMultiplexingClass(); Label1.Text = warning.SimilarityDetect(a, b).ToString(); }
protected void Page_Load(object sender, EventArgs e) { string receive = TextBox1.Text; string test = "asdfghjkl";//此字符串应该从数据库:Admin中的【密码】中提取 MultipurposeMultiplexingClass MM = new MultipurposeMultiplexingClass(); Label1.Text = MM.SimilarityDetect(receive, test).ToString(); }
private void AdminLogin() { /** * 查询是否存在 管理员 */ string sPasswordReceive = TBAdministratorPassword.Text; AdminInfoBusiness GetAdminInfo = new AdminInfoBusiness(); AdminInfoEntity AdminInfo = new AdminInfoEntity(); AdminInfo = GetAdminInfo.GetAdminInfoByAdminAccount(); int iReturnValue = (int)GetAdminInfo.AdminExistJudgementByAdminAccount(TBAdministratorAccount.Text); if (iReturnValue > 0) { MultipurposeMultiplexingClass DataEncrypt = new MultipurposeMultiplexingClass(); string sEncryptPassword = DataEncrypt.DataEncryptMethod(TBAdministratorPassword.Text); string sAdminPassword = AdminInfo.saadminPasswords[0]; MultipurposeMultiplexingClass AttractedWarningLevel = new MultipurposeMultiplexingClass(); int iReturnLevel = AttractedWarningLevel.SimilarityDetect(sEncryptPassword, sAdminPassword);//相似度检测算法,用以防止爆破攻击 if (iReturnLevel == 100) { Response.Redirect("~/01AdminCentre.aspx"); } else { Response.Redirect("~/0000.aspx"); } } else { Response.Redirect("~/0000.aspx"); } }