⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 login.cs

📁 学生选课系统开发工具VS2003.NET+Sqlserver2000 功能:基本学生及老师信息
💻 CS
字号:
using System;
using System.Web;
using System.Web.Security;

namespace SbElect.UserInfor
{
	/// <summary>
	/// Login 的摘要说明。
	/// </summary>
	public class Login
	{
		public Login()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}
		public bool loginByState(string UserName,string UserPwd)
		{
			Dal.User Dal=new SbElect.Dal.User();
			int state=Dal.CheckState(UserName,UserPwd);
			int UserID=Dal.CheckUserID(UserName,UserPwd);
			if(state!=0 )
			{
				//添加用户名
				HttpCookie cookieUserName = new HttpCookie("UserName",UserName.ToString());
				System.Web.HttpContext.Current.Response.Cookies.Add(cookieUserName);
				//添加密码
				HttpCookie cookieUserPwd = new HttpCookie("UserPwd",UserPwd.ToString());
				System.Web.HttpContext.Current.Response.Cookies.Add(cookieUserPwd);
				//添加用户编号
				HttpCookie cookieUserID = new HttpCookie("UserID",UserID.ToString());
				System.Web.HttpContext.Current.Response.Cookies.Add(cookieUserID);
				//添加用户编号state
				HttpCookie cookieState = new HttpCookie("state",state.ToString());
				System.Web.HttpContext.Current.Response.Cookies.Add(cookieState);
				return true;
			}
			else
			{
				return false ;
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -