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

📄 login.cs

📁 毕业设计题目,学生成绩查询系统,包括管理员和普通用户两级管理
💻 CS
字号:
using System;
using System.Data;
using System.Data.SqlClient;

namespace StudentScroeQuery.DAL
{
	/// <summary>
	/// login 的摘要说明。
	/// </summary>
	public class login:helper
	{
		public login()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}
		public bool studentlogin(int num,string password)
		{
			this.comm.CommandText="select count(Student_name) from Student where Student_Id=@studentid and [Student_password]=@password";
			this.comm.Parameters.Add("@studentid",SqlDbType.Int).Value=num;
			this.comm.Parameters.Add("@password",SqlDbType.VarChar).Value=System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(password,"md5");
			int count=this.ExcuteCommandReturnNumber(this.comm);
			if(count!=0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		//修改登录密码
		public void updatepwd(int userid,string password)
		{
			comm.CommandText="update Student set Student_password=@password where Student_id=@userid";
			comm.Parameters.Add("@password",SqlDbType.VarChar).Value=password;
			comm.Parameters.Add("@userid",SqlDbType.Int).Value=userid;
			this.ExcuteCommandReturnVoid(comm);
		}
	
	}
}

⌨️ 快捷键说明

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