HRSys_Prj/Login.aspx.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using BLL;
using System.Net;
namespace HrDB
{
public partial class Login : System.Web.UI.Page
{
BLL.Login bll_Login = new BLL.Login();
protected void Page_Load(object sender, EventArgs e)
{
SaveUserInfo();
}
private void SaveUserInfo()
{
Cookie = Request.Cookies["LoginInfo"];
if (Cookie != null)
{
txtName.Text = Cookie.Values["userName"];
//asp.net中的TextBox如果TextMode为Password的时候不支持直接赋值,
//在此处以添加属性的方式把读取的密码赋值给密码框
txtPwd.Attributes.Add("value", CookiesHelper.DecryptQueryString
(Cookie.Values["Pwd"].ToString()));
}
}
/// <summary>
/// 登录
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnLogin_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(txtName.Text))
{
return;
}
if (string.IsNullOrEmpty(txtPwd.Text))
{
return;
}
if (bll_Login.GetLogin(txtName.Text, txtPwd.Text).Rows.Count > 0)
{
if (txtName.Text == bll_Login.GetUserName(txtName.Text))
{
Session["UserName"] = txtName.Text;
//生成的验证码被保存到session中
if (Session["CheckCode"] != null)
{
string checkcode = Session["CheckCode"].ToString();
if (CheckBox1.Checked)
{
this.SaveCookie(txtName.Text, CookiesHelper.EncryptQueryString
(Server.UrlEncode(txtPwd.Text)));
后面还有 47 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。