论文无忧网提供:计算机毕业论文范文|计算机毕业设计|计算机毕业论文
栏目导航 ASP JSP .NET VB6.0 JAVA VC VF DELPHI PB 计算机网络 计算机科学与技术 PHP 其他 代写论文
当前位置: 澳门大西洋城开户 > 计算机 > JSP >

A400214光盘CD销售管理系统

<H3>

<P>修改密码,密码长度不能超过30个字符:

http://snowings.com

<%String str=response.encodeURL("modifyPassword.jsp");

paper51.com

%> copyright paper51.com

<H3>

paper51.com

<FORM action="<%=str%>"Method="post">

paper51.com

<BR>输入您的用户名: 内容来自论文无忧网 snowings.com

<BR><Input type=text name="logname" value="<%=login.getLogname()%>" >

http://snowings.com

<BR>输入您的密码:

http://snowings.com

<BR><Input type=password name="password"> 内容来自snowings.com

<BR>输入您的新的密码: http://snowings.com

<BR><Input type=text name="newPassword1">

内容来自论文无忧网 snowings.com

<BR>请再输入一次新密码:

paper51.com

<BR><Input type=text name="newPassword2"> http://snowings.com

<BR><Input type=submit name="g" value="提交">

内容来自论文无忧网 snowings.com

</FORM> copyright paper51.com

<%!//处理字符串的一个常用方法:

copyright paper51.com

    publicString getString(String s)

copyright paper51.com

     { if(s==null) s=""; http://snowings.com

       try {byte a[]=s.getBytes("ISO-8859-1");

paper51.com

           s=new String(a); http://snowings.com

          } http://snowings.com

       catch(Exception e)

copyright paper51.com

          {  } http://snowings.com

       return s; 内容来自snowings.com

     }

内容来自snowings.com

 %> paper51.com

<%

内容来自snowings.com

    Stringlogname=request.getParameter("logname"); //获取提交的用户名。 内容来自论文无忧网 snowings.com

          logname=getString(logname); copyright paper51.com

    Stringpassword=request.getParameter("password"); //获取提交的密码。 http://snowings.com

          password=getString(password);

paper51.com

    StringnewPassword1=request.getParameter("newPassword1"); //获取提交的新密码1。 copyright paper51.com

          newPassword1=getString(newPassword1);

paper51.com

    StringnewPassword2=request.getParameter("newPassword2"); //获取提交的新密码2。 内容来自论文无忧网 snowings.com

       newPassword2=getString(newPassword2); 内容来自snowings.com

     try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); copyright paper51.com

      }

http://snowings.com

     catch(ClassNotFoundException event){}

http://snowings.com

    //验证身份: 内容来自论文无忧网 snowings.com

    Connectioncon=null;

http://snowings.com

    Statementsql=null;

copyright paper51.com

    booleanmodify=false;

http://snowings.com

    booleanifEquals=false; 内容来自snowings.com

        ifEquals=(newPassword1.equals(newPassword2))&&(newPassword1.length()<=30);

内容来自论文无忧网 snowings.com

    if(ifEquals==true) paper51.com

       {  try{con=DriverManager.getConnection("jdbc:odbc:shop","","");

http://snowings.com

               sql=con.createStatement(); paper51.com

               boolean bo1=logname.equals(login.getLogname()), paper51.com

                     bo2=password.equals(login.getPassword()); paper51.com

               if(bo1&&bo2) 内容来自snowings.com

                   {//修改密码: http://snowings.com

                    modify=true; 内容来自snowings.com

                    out.print("您的密码已经更新");

paper51.com

                    String c="UPDATE user SET password ="+"'"+newPassword1+"'"+

内容来自论文无忧网 snowings.com

                    " WHERE logname = "+"'"+logname+"'";

copyright paper51.com

                    sql.executeUpdate(c); http://snowings.com

                   }

copyright paper51.com

               con.close(); paper51.com

              }

内容来自snowings.com

            catch(SQLException e1) {} 内容来自snowings.com

       } copyright paper51.com

    else http://snowings.com

      { out.print("你两次输入的密码不一致或长度过大"); paper51.com

      } 内容来自snowings.com

    if(modify==false&&ifEquals==true)

copyright paper51.com

 { out.print("<BR>您没有输入密码帐号或<BR>您输入的帐号或密码不正确"+logname+":"+password); paper51.com

 } 内容来自论文无忧网 snowings.com

%>

内容来自snowings.com

(4)商品浏览 showBookList.jsp:

copyright paper51.com

<P> 商品目录:

paper51.com

 <%! //声明一个共享的连接对象: copyright paper51.com

    Connectioncon=null; 内容来自snowings.com

    //显示数据库记录的方法:

http://snowings.com

    publicvoid showList(ResultSet rs,javax.servlet.jsp.JspWriter  out,int n,String buybook) http://snowings.com

     {try

copyright paper51.com

      {

内容来自论文无忧网 snowings.com

    内容来自论文无忧网 snowings.com

------分隔线----------------------------
联系方式