用户登陆问题 .NET+ACCESS+C#

问题描述

错误提示:ServerErrorin'/'Application.--------------------------------------------------------------------------------ParserErrorDescription:Anerroroccurredduringtheparsingofaresourcerequiredtoservicethisrequest.Pleasereviewthefollowingspecificparseerrordetailsandmodifyyoursourcefileappropriately.ParserErrorMessage:CouldnotloadtypeSystem.Web.UI.WebControls.LoginfromassemblySystem.Web,Version=1.0.5000.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a.SourceError:Line11:<tr>Line12:<tdheight="52"align="center">Line13:<asp:LoginID="Login1"runat="server"BackColor="#F7F7DE"Line14:BorderColor="#CCCC99"Line15:BorderStyle="solid"BorderWidth="1px"SourceFile:E:aspxLogon.aspxLine:13--------------------------------------------------------------------------------VersionInformation:Microsoft.NETFrameworkVersion:1.1.4322.2407;ASP.NETVersion:1.1.4322.2407文件web.config代码__________________<?xmlversion="1.0"encoding="utf-8"?><configuration><appSettings><addkey="ConnectionString"value="dataBOOK.mdb"/></appSettings><system.web><compilationdefaultLanguage="c#"debug="true"/><customErrorsmode="Off"/><authenticationmode="Windows"/><authorization><allowusers="*"/></authorization><traceenabled="false"requestLimit="10"pageOutput="false"traceMode="SortByTime"localOnly="true"/><sessionStatemode="InProc"stateConnectionString="tcpip=127.0.0.1:42424"sqlConnectionString="datasource=127.0.0.1;Trusted_Connection=yes"cookieless="false"timeout="20"/><globalizationrequestEncoding="gb2312"responseEncoding="gb2312"/><pagesvalidateRequest="false"/></system.web></configuration>logon.aspx________________<%PageLanguage="C#"AutoEventWireup="true"CodeFile="Logon.aspx.cs"Inherits="Logon"%><!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><headrunat="server"><title>Login.axp</title></head><body><formid="form1"runat="server"><tableheight="100%"cellSpacing="0"cellpadding="0"width="100%"border="0"><tr><tdheight="52"align="center"><asp:LoginID="Login1"runat="server"BackColor="#F7F7DE"BorderColor="#CCCC99"BorderStyle="solid"BorderWidth="1px"Font-Names="Verdana"Font-Size="10px"OnAuthenticate="OnAuthenticate"><TitleTextStyleBackColor="#6B696B"Font-Bold="True"ForeColor="#FFFFFF"/></asp:Login><br/><ahref="CreateUser.aspx">newuserregister</a></td></tr></form></body></html>文件logon.aspx.cs代码_____________usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingSystem.Data.OleDb;publicpartialclassLogon:System.Web.UI.Page{//用户身份验证publicvoidOnAuthenticate(objectsender,AuthenticateEventArgse){boolAuthenticated=false;Authenticated=SiteSpecificAuthenticationMethod(Login1.UserName,Login1.Password);e.Authentciated=Authenticated;}//在数据库中检验privateboolSiteSpecificAuthenticationMethod(stirngUserName,stringpassword){stringstrUserName,strPWD;//NAMEKEY;stringstrSql;//SQLOleDbDataReadermyReader;strUserName=Login1.UserName;strPWD=Login1.Password;strSql="select*fromUserswhereuserid='"+strUserName+"'";clsDBdbo=newclsDB();myReader=dbo.GetResultAsDataReader(strSql);if(myReader.Read()){//存在此用户stringstrUserPwd=myReader["userpassword"].ToString();if(strPWD==strUserPwd){//密码正确Response.Redirect("~/default.aspx");myReader.Close();myReader.Dispose();dbo.killMe();returntrue;}else{Login1.FailureText="密码错误";myReader.Close();myReader.Dispose();dbo.killMe();returnfalse;}}else{//用户不存在Login1.FailureText="用户不存在";myReader.Close();myReader.Dispose();dbo.killMe();returnfalse;}}protectedvodiPage_Load(objectsender,EventArgse){}}文件App_Code/clsDB.cs代码__________________usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSystem.Web.UI.HtmlControls;usingSystem.Data.OleDb;publicclassclsDB{publicOleDBConnectionConncetion;publicclsDB(){Connection=newOleDBConnection(connectionString());Conncetion.Open();}privatestringconnectionString(){returnSystem.Configuration.ConfigurationManger.AppSettings["ConnectionString"];}publicOleDbDataReaderGetResultAsDataReader(stringstrSql){OleDbCommandcommand=newOleDbCommand(strSql,Connection);if(Connection.State==ConnectionState.Closed)Connection.Open();returncommand.ExecuteReader();}publicstringExecuteNoReturn(stringstrSql,stringstrTip){stringstrReturn;OleDbCommandmyCommand=newOleDbCommand(strSql,Connection);try{if(Connection.State==ConnectionState.Closed)Connection.Open();myCommand.ExecuteNonQuery();strReturn=strTip+"succeed";}catch{strReturn=strTip+"false";}myCommand.Dispose();Conneciton.Close();returnstrReturn;}publicvoidkillMe(){Connection.Dispose();}}

解决方案

解决方案二:
logon.aspx________________<%PageLanguage="C#"AutoEventWireup="true"CodeFile="Logon.aspx.cs"Inherits="Logon"%><!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><headrunat="server"><title>Login.axp</title></head><body><formid="form1"runat="server"><tableheight="100%"cellSpacing="0"cellpadding="0"width="100%"border="0"><tr><tdheight="52"align="center"><asp:LoginID="Login1"runat="server"BackColor="#F7F7DE"BorderColor="#CCCC99"BorderStyle="solid"BorderWidth="1px"Font-Names="Verdana"Font-Size="10px"OnAuthenticate="OnAuthenticate"/><TitleTextStyleBackColor="#6B696B"Font-Bold="True"ForeColor="#FFFFFF"/></asp:Login><br/><ahref="CreateUser.aspx">newuserregister</a></td></tr></form></body></html>少了个/
解决方案三:
publicpartialclassLogon===============这里换一个类名,比如LoginFormpublicpartialclassLoginForm别忘了aspx也要修改<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="Login.aspx.cs"Inherits="LoginForm"%>你的类名和ASP.NET提供的控件名冲突了
解决方案四:
Microsoft.NETFrameworkVersion:1.1.4322.2407;ASP.NETVersion:1.1.4322.2407===貌似用的.NET1.1,那应该不是我刚才提到的问题,sorry

时间: 2024-07-29 13:26:29

用户登陆问题 .NET+ACCESS+C#的相关文章

用户登陆例子 .NET+ACCESS+C#

问题描述 谁能单独做了个最简单的用户登陆例子给我,万分感谢!!!对于我来说,那真的好有难度!!!.NET+ACCESS(SQL)+C#贴代码和ACCESS(SQL)数据库描述即可. 解决方案 解决方案二:老兄,从数据库查表的记录您会吗?如果会了那不难,先从简单的开始:建个form,加入数据基本组件,查询,取得用户名及密码,然后与用户输入的信息相比较,符合则登录显示您的主窗口,

asp.net IHttpModule模板用户登陆代码实例

asp教程.net ihttpmodule模板用户登陆代码实例 void application_acquirerequeststate(object source, eventargs e)         {             httpapplication application = (httpapplication)source;             user user = (user)application.context.session["user"]; //获取

asp中一个简单的用户登陆验证类

源代码如下: <%'========================================================================== ' ' 用户登陆身份验证类 ' ' NAME: CheckLogin ' ' AUTHOR: Infozero ' DATE : 2006-5-28 ' ' COMMENT: 用户登陆身份验证类 ' '================================================================

开源中国iOS客户端学习 (十二) 用户登陆

上一篇博客  开源中国iOS客户端学习--(十一)AES加密 中提到将用户名和密码保存到了本地沙盒之中,在从本地读取用户名和密码,这是一个怎样的过程? -(void)saveUserNameAndPwd:(NSString *)userName andPwd:(NSString *)pwd { NSUserDefaults * settings = [NSUserDefaults standardUserDefaults]; [settings removeObjectForKey:@"User

Ajax+asp.net实现用户登陆

 这篇文章主要介绍了Ajax+asp.net实现用户登陆,主要是为了练习ajax的使用方法,有需要的小伙伴参考下.     以用户登录为例练习ajax的使用方法 login.html ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55

Flash表单制作实例:用户登陆系统

第5节 用户登陆系统 使用Flash制作的表单可以用做网站的登陆入口,至于输入特定的用户名和密码,才可以进入该网站,本实例就来制作一个简单的用户登陆系统,如果输入的密码和用户名相同,则可以登陆到网站上,如果不相同,则给出提示信息,不能登陆到网站. 此登陆系统界面如图5.1所示;   图5.1 用户登陆系统主界面 比如我们在用户名文本框中输入User,然后在密码文本框中也输入Use,则自动打开Ie浏览器窗口,进入网站,如果输入的密码和用户名不相同,则给出如图5.2所示的出错信息:   图5.2 出

js+php实现静态页面实时调用用户登陆状态的方法

 这篇文章主要介绍了js+php实现静态页面实时调用用户登陆状态的方法,采用在静态页面中使用js调用php页面从而实现用户登录状态的实时调用功能,需要的朋友可以参考下     本文实例讲述了js+php实现静态页面实时调用用户登陆状态的方法.分享给大家供大家参考.具体分析如下: 在程序开发中,经常会把页面做成html的静态形式,这样可以减轻服务器负载,但是也存在一个问题就是当注册用户登陆时,要在html页面显示登陆成功或需要登陆的提示,这样我们就必须想其它办法来实现了,下面我们就是利用js+ph

php+mysql做后台,怎么实现用户登陆,推送消息

问题描述 php+mysql做后台,怎么实现用户登陆,推送消息 大概情况是这样的: 当A登陆以后,可以发消息给B,如下图,选择B的工号 发送以后,B登陆,可以在部门消息那里会显示一个小红点,提示有消息 我的思路是这样的:当A按下发送以后,就向存放消息的数据库里写一条记录,并把消息的状态码设置成未读,接收人是B,当B登陆以后,因为状态码是未读,就会显示提示信息.可是这个提示怎么实现? 这是我消息的数据库: 如果我一次发同样的消息给多个人,是不是应该写多条记录?向数据库写消息要循环? 还有一个问题是

PHP采用curl模仿用户登陆新浪微博发微博的方法_php技巧

本文实例讲述了PHP采用curl模仿用户登陆新浪微博发微博的方法.分享给大家供大家参考.具体实现方法如下: 现在用php做模仿用户登录我们都会使用到PHP curl函数了,因为只有它才可以实现像用户一样的去访问别人网站了,下面就给大家介绍一下curl登陆新浪微博发微博应用例子. 前天接到一个需求需要模拟登陆微博然后进行发微博,以前干过很多的模拟登录阿里妈妈,微信,还有些其他的内部系统,至今没有出现不能登录的,哈哈,所以也就没有当一回事情,可是当分析新浪的登陆过程的时候才感觉到压力 遇到sha1(