HyperLesson/Login.aspx.cs
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using BLL;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace HyperLesson
{
public partial class Login1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
//MD5加密
// 32 位
public static String Encrypt(String s)
{
MD5 md5 = new MD5CryptoServiceProvider();
byte[] bytes = System.Text.Encoding.UTF8.GetBytes(s);
bytes = md5.ComputeHash(bytes);
md5.Clear();
string ret = "";
for (int i = 0; i < bytes.Length; i++)
{
ret += Convert.ToString(bytes[i], 16).PadLeft(2, '0');
}
return ret.PadLeft(32, '0');
}
protected void loginteacher_Click(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
if (userPwd.Text.Length <6 || userPwd.Text.Length >16)
{
Response.Write("<script>alert('密码长度超出范围!');location.href='Login.aspx';</script>");
return;
}
if (this.userName.Text != "" && this.userPwd.Text != "")
{
if (this.userName.Text == "admin")
{
Session["userName"] = this.userName.Text;
//获取用户名和密码
string userName = Request["userName"];
//string userPwd = Encrypt(Request["userPwd"]);
string userPwd = Request["userPwd"];
Model.Admin qmz = LoginManager.getAdminInfo(userName, userPwd);
if (qmz == null)
{
Response.Write("<script>alert('账号或密码不正确!');location.href='Login.aspx';</script>");
return;
}
Session["userinfo"] = qmz;
//引用BLL里的BLL_yanZheng()方法,实例化对象
LoginManager tbl = new LoginManager();
后面还有 114 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。