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(); }
protected void Page_Load(object sender, EventArgs e) { string s = TextBox1.Text; MultipurposeMultiplexingClass DataEncrypt = new MultipurposeMultiplexingClass(); Label1.Text = DataEncrypt.DataEncryptMethod(s); Label2.Text = DataEncrypt.DataDecipherMethod(DataEncrypt.DataEncryptMethod(s)); Label3.Text = DataEncrypt.DataEncryptMethod(s).Length.ToString(); TextBox2.Text = DataEncrypt.DataDecipherMethod(DataEncrypt.DataEncryptMethod(s)); }
private void BoardMemberGreetings() { /** * 使用 继承+多态 来实现问候 */ int iNowTime = int.Parse(DateTime.Now.ToString("HH")); MultipurposeMultiplexingClass UsersGreetingsMethod = new MultipurposeMultiplexingClass(); UsersGreetingsMethod.UsersGreetingsMethod(iNowTime); string sAdminGreetings = UsersGreetingsMethod.UsersGreetingsMethod(iNowTime); LBLBoardGreetings.Text = sAdminGreetings; }
private void CounsellorGreetings() { /** * 使用继承来实现问候 */ int iNowTime = int.Parse(DateTime.Now.ToString("HH")); MultipurposeMultiplexingClass UsersGreetingsMethod = new MultipurposeMultiplexingClass(); UsersGreetingsMethod.UsersGreetingsMethod(iNowTime); string sClientGreetings = UsersGreetingsMethod.UsersGreetingsMethod(iNowTime); LBLCounsellorGreetings.Text = sClientGreetings; }
private void DefaultDisPlayInfo() { AdminInfoBusiness AdminInfoBusiness = new AdminInfoBusiness(); AdminInfoEntity AdminInfo = new AdminInfoEntity(); AdminInfo = AdminInfoBusiness.GetAdminInfoByAdminAccount(); if (!IsPostBack) { MultipurposeMultiplexingClass DataEncrypt = new MultipurposeMultiplexingClass(); TBAdminAccount.Text = AdminInfo.sadminAccount; string sDecipherPassword = DataEncrypt.DataDecipherMethod(AdminInfo.saadminPasswords[0]); LBLAdminPasswordShow.Text = sDecipherPassword; } }
protected void AdminInfoUpdate_Click(object sender, EventArgs e) { MultipurposeMultiplexingClass DataEncrypt = new MultipurposeMultiplexingClass(); string sEncryptPassword = DataEncrypt.DataEncryptMethod(TBAdminPassword.Text); MultipurposeMultiplexingClass AdminHistoricalPasswordExistDetect = new MultipurposeMultiplexingClass(); int iResultJudgement = AdminHistoricalPasswordExistDetect.AdminHistoricalPasswordDetect(sEncryptPassword); if (iResultJudgement > 0) { Response.Write("<script>alert('修改失败!存在相同的历史密码')</script>"); } else { AdminAllInfoUpdate(sEncryptPassword); } }
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"); } }
protected void BTNSearch_Click(object sender, EventArgs e) { MultipurposeMultiplexingClass OracleSearch = new MultipurposeMultiplexingClass(); LBLAlert.Text = OracleSearch.Oracle(TBSearch.Text); }