📄 newfolder.jsp
字号:
<%@ page language="java" pageEncoding="gbk"%>
<%@ include file="conf.jsp"%>
<%
//文件管理系统 V1.0
//2009-2-17
//woody_2006@163.com
String parent = new String(request.getParameter("parent").getBytes("iso-8859-1"),"GBK");
String action = request.getParameter("action");
File[] curFiles = null;
if(!Tool.isEmp(parent))
{
curFiles = FileUtil.getFileList(FileUtil.replWebToFilePath(parent));
}
if("update".equals(action))
{
String newName = new String(request.getParameter("newname").getBytes("iso-8859-1"),"GBK");
FileUtil.createDirectory(parent+"\\"+newName);
out.println(Tool.makeSimpleMsg("操作成功!"));
out.println("<script>window.opener.opener = null;window.opener.location.replace(window.opener.location.href);window.close();</script>");
}
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<title>文件管理系统 V1.0 by woody_2006@163.com</title>
<meta http-equiv="Expires" content="0"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Pragma" content="no-cache"/>
<link href="skin_1/style.css" type="text/css" rel="stylesheet"/>
<script type="text/javascript">
function check()
{
var newName = document.getElementById("newname");
if(newName.value=="")
{
alert("名称还没写呢!");
newName.focus();
return false;
}
var fileArr=new Array(<%=curFiles.length%>)
<%
for(int i=0;i<curFiles.length;i++)
{
%>
fileArr[<%=i%>] = "<%=curFiles[i].getName().toLowerCase()%>";
<%
}
%>
for(var i=0;i<fileArr.length;i++)
{
if(fileArr[i]==newName.value.toLowerCase())
{
alert("当前文件夹中已有:"+newName.value+",请换个其它名称!");
return false;
}
}
return true;
}
</script>
</head>
<body class="htmlbody">
<p align=center><b>新建文件夹</b></p>
<form action="" target=_self onsubmit="return check()">
<input type=hidden value="update" name="action">
<input type=hidden value="<%=parent%>" name="parent">
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<tr>
<td width="30%" class="tablerow2">路径</td>
<td class="tablerow2">
<%=FileUtil.replWebToFilePath(parent)%>
</td>
</tr>
<tr>
<td width="30%" class="tablerow1">文件夹名称:</td>
<td class="tablerow1">
<input type=text value="" name="newname" size="30"/>
</td>
</tr>
</table>
<p align=center>
<input type=submit class="button" value=" 确 定 "/>
<input type=button class="button" onclick="window.close()" value=" 取 消 "/></p>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -