hadoop网盘环境搭建,代码全部过程(7)
用户名 手机号 邮箱 密码
修改邮箱 修改密码 更换绑定手机号 更多
网盘
<% FileStatus[] list = (FileStatus[])request.getAttribute(\); %>
文件
31 / 53 文件名 属性 大小 删除 下载
<%
String path=null;
path=list[0].getPath().toString().substring(18,list[0].getPath().toString().length()-list[0].getPath().
if(list != null)
for (int i=0; i %> <% %> <%= (list[i].isDir()?\目录\:\文件\) %> <%= list[i].getLen()/1024%> 32 / 53 getName().toString().length()).toString(); if(list[i].isDir()) { out.print(\ href=\\\+list[i].getPath()+\+list[i].getPath().getName()+\); }else{ } out.print(\+list[i].getPath().getName()+\); g(),\) %>&mypath=<%=list[i].getPath().toString().substring(18,list[i].getPath().toString().length()-list[i].getPath().getName().toString().length()).toString()%>\> g(),\) %>&mypath=<%=list[i].getPath().toString().substring(18,list[i].getPath().toString().length()-list[i].getPath().getName().toString().length()).toString()%>\>下载 二、数据交互 数据库连接: publicclass ConnDB { } 检测用户登录是否合法: public class UserBeanCl { private Connection ct = null; public Connection getConn(){ try { //加载驱动 Class.forName(\); //得到连接 ct = } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } returnct; } DriverManager.getConnection(\); private Statement sm = null; private Connection ct = null; private ResultSet rs = null; public void close(){ try { if(sm != null){ } if(ct != null){ } if(rs != null){ } 34 / 53 sm.close(); sm = null; ct.close(); ct = null; rs.close(); rs = null; } } } catch (SQLException e) { } // TODO Auto-generated catch block e.printStackTrace(); //检查登录用户是否合法 public boolean checkUser(String user, String password){ } boolean b = false; try { //获得连接 } return b; ct = new ConnDB().getConn(); //创建statement sm = ct.createStatement(); rs = sm.executeQuery(\if(rs.next()){ } //说明用户存在 String pwd = rs.getString(3); if(password.equals(pwd)){ } b = false; //说明密码正确 b = true; b = false; }else{ }else{ } catch (SQLException e) { e.printStackTrace(); this.close(); }finally{ 用户注册部分与数据库的交互主要代码: publicbooleancreateUser(String id,String user, String password,String emal) throws SQLException{ booleanb = false; 35 / 53 相关推荐:
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2




