专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > ASP.NET

错误详细信息: System.IndexOutOfRangeException: ChatAdmin如何解决

发布时间:2011-06-22 17:15:17 文章来源:www.iduyao.cn 采编人员:星星草
异常详细信息: System.IndexOutOfRangeException: ChatAdmin怎么解决
这个异常是怎么回事??

我在PG666下了一个WEB红警的源码,是asp.net的,数据库建好了,web服务器配好了,我想把它作为单机玩。
能够注册新用户了,后台管理也可以登录,但是当我用新建账号登录是缺抛出未处理异常

“/”应用程序中的服务器错误。
--------------------------------------------

ChatAdmin 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.IndexOutOfRangeException: ChatAdmin //我还不明白ChatAdmin是什么,到底是系统的,还是
  //程序的

源错误: 
行 52: //UserPrincipal.SignOut();
行 53:  
行 54: if (UserPrincipal.Login(username, password,false))
行 55:  
行 56: {
 源文件: d:\WEBserver\sites\Game\index.aspx.cs 行: 54 

堆栈跟踪: 
[IndexOutOfRangeException: ChatAdmin]
  System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName) +4839074
  System.Data.SqlClient.SqlDataReader.GetOrdinal(String name) +67
  System.Data.SqlClient.SqlDataReader.get_Item(String name) +15
  WebGame.Module.UserPrincipal.Login(String userName, String password, Boolean remember) +1788
  index.btnLogin_Click(Object sender, EventArgs e) in d:\WEBserver\sites\Game\index.aspx.cs:54
  System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +111
  System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +79
  System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
  System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
  System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

 


--------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.3625; ASP.NET 版本:2.0.50727.3053 





错误代码具体如下:
  protected void btnLogin_Click(object sender, EventArgs e)
  {
  string username = txtUserName.Text.Trim();
  string password = MD5.Encode(txtPassword.Text.Trim(), 32);
  string checkCode = txtCheckCode.Text.Trim().ToLower();
  string strJs = "";

  if (Session["CheckCode"] == null)
  {
  strJs = StringUtil.Js_BackStr("验证码错误!");
  Page.ClientScript.RegisterStartupScript(this.GetType(), "myJs", strJs);
  return;
  }
  if (checkCode != Session["CheckCode"].ToString().ToLower())
  {
  strJs = StringUtil.Js_BackStr("验证码错误!");
  Page.ClientScript.RegisterStartupScript(this.GetType(), "myJs", strJs);
  return;
  }
  if (username != "" && password != "")
  {
  //UserPrincipal.SignOut();
   
  if (UserPrincipal.Login(username, password,false))//这就是异常点
  //UserPrincipal 类定义在WebGame.Module命名空间中  
  {
  UserPrincipal user = UserPrincipal.GetCurrent();
  int cityID = CityDB.GetCapitalID(user.UserID);
  if (cityID == 0)
  {
  StringUtil.Self_Location("select.aspx");
  }
  else
  {
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: