当前上下文中不存在名称db 5
usingSystem;usingSystem.Collections;usingSystem.Configuration;usingSystem.Data;usingS...
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//this.txtName.Text = "admin";
//this.txtPwd.Text = "md666";
//保存默认当前投票选项ID
Session["id"] = db.getCid("select id from votemaster order by id asc");
}
protected void btnLogin_Click(object sender, EventArgs e)
{
string name = this.txtName.Text.ToString();
string pwd = this.txtPwd.Text.ToString();
if (db.isUser(name, pwd))
{
string qx = db.getValue("select qx from admin where name='" + name + "'and pwd='" + pwd + "'");
if (db.getQX(name, pwd) == "管理员")
{
Session["qx"] = "管理员";
Session["flag"] = "true"; //登录成功标志
this.hlkadmin.Visible = true;
this.hlkadmin.NavigateUrl = "voteadminManager.aspx";
this.labLogin.Text = "尊敬的管理员您好";
.......................... 展开
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//this.txtName.Text = "admin";
//this.txtPwd.Text = "md666";
//保存默认当前投票选项ID
Session["id"] = db.getCid("select id from votemaster order by id asc");
}
protected void btnLogin_Click(object sender, EventArgs e)
{
string name = this.txtName.Text.ToString();
string pwd = this.txtPwd.Text.ToString();
if (db.isUser(name, pwd))
{
string qx = db.getValue("select qx from admin where name='" + name + "'and pwd='" + pwd + "'");
if (db.getQX(name, pwd) == "管理员")
{
Session["qx"] = "管理员";
Session["flag"] = "true"; //登录成功标志
this.hlkadmin.Visible = true;
this.hlkadmin.NavigateUrl = "voteadminManager.aspx";
this.labLogin.Text = "尊敬的管理员您好";
.......................... 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询