爱问知识人 爱问教育 医院库

Authenticated 如何引用?

首页

Authenticated 如何引用?

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
//using System.Web.Authenticated;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    {
        bool Authenticated = false;
        Authenticated = SiteLevel(Login1.UserName, Login1.Password);
        e.Anthenticated = Anthenticated;
        if (Anthenticated == true)
        {
            Response.Redirect(" ");
        }
    }
    private bool SiteLevel(string UserName, string Password)
    {
        bool boolreturnvalue = false;
        string strConnection = "server=localhost;database=dodo;uid=sa;pwd=;";
        SqlConnection Connection = new Sqlconnection(strConnection);
        String strSQL = "Select * from user";
        SqlCommand command = new SqlCommand(strSQL, Connection);
        SqlDataReader Dr;
        Connection.Open();
        Dr = command.ExecuteReader();
        while (Dr.Read())
        {
            if ((UserName == Dr["uname"].ToString()) & (Password == Dr["password"].ToString()))
            {
                boolreturnvalue = true;
            }
            Dr.Close();
            return boolreturnvalue;
        }

    }
}



编了这层代码,如何出现以下错误
错误  1  “System.Web.UI.WebControls.AuthenticateEventArgs”并不包含“Anthenticated”的定义  C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\WebSite2\ px.cs  22  11  C:\...\WebSite2\
错误  2  当前上下文中不存在名称“Anthenticated”  C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\WebSite2\ px.cs  22  27  C:\...\WebSite2\
错误  3  当前上下文中不存在名称“Anthenticated”  C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\WebSite2\ px.cs  23  13  C:\...\WebSite2\
错误  4  找不到类型或命名空间名称“SqlConnection”(是否缺少 using 指令或程序集引用?)  C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\WebSite2\ px.cs  32  9  C:\...\WebSite2\
错误  5  找不到类型或命名空间名称“Sqlconnection”(是否缺少 using 指令或程序集引用?)  C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\WebSite2\ px.cs  32  40  C:\...\WebSite2\
错误  6  找不到类型或命名空间名称“SqlCommand”(是否缺少 using 指令或程序集引用?)  C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\WebSite2\ px.cs  34  9  C:\...\WebSite2\

本人菜鸟,请高手出手帮忙~

提交回答

类似问题

换一换
  • C#/.NET 相关知识

  • 电脑网络技术
  • 电脑网络

相关推荐

正在加载...
最新问答 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):