asp.net 用户密码修改问题 我是个新手,在做用户界面时遇到如下问题(注册时密码用MD5加密)

索引超出范围。必须为非负值并小于集合大小。
参数名: index
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.ArgumentOutOfRangeException: 索引超出范围。必须为非负值并小于集合大小。
参数名: index

源错误:

行 46: else
行 47: { %>
行 48: 您好: <a href="../member/user.aspx?n=<%=staticlu[0].UserName %>"><%=staticlu[0].UserName %></a><span id="nav_quick"> | <a href="../member/user.aspx?n=<%=staticlu[0].UserName %>" id="my_space" target="_blank">我的空间</a>
行 49: | <a id="my_cp" href="../member/index.aspx" target="_blank">用户中心</a> | <a id="msg_num" href="../member/msg_f.aspx">(<span class="newmsg"><%=unreadnum%></span>)条未读短信</a> | <a title="退出登录" href="../logout.aspx">退出登录</a>
行 50: <%} %>
源文件: d:\CarBuQiLuo\CarBuQiLuo\content\UserCenter.Master 行: 48

////报错后,数据库中密码数据被修改但格式不对

////以下为修改密码的代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CarBuQiLuo.SQLServer;
using CarBuQiLuo.Model;

namespace CarBuQiLuo.member
{
public partial class pwd : System.Web.UI.Page
{
CarBuQiLuoUsersControler UC = new CarBuQiLuoUsersControler();
protected void Page_Load(object sender, EventArgs e)
{
if (this.IsPostBack)
{
string name = Request.Cookies["cookie_name"].Value.ToString();
string password = Request["newpw"].ToString();

if (UC.UpdateUserPwd(name, password))
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "err", "alert('修改成功')", true);
}
else
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "err", "alert('修改失败')", true);
Response.Redirect("../Err.htm");
}
}
}
}
}

第1个回答  2011-07-28
static lu[0] 这个是什么?
相似回答
大家正在搜