【JSP开源代码栏目提醒】:网学会员在JSP开源代码频道为大家收集整理了ex9_03.jsp提供大家参考,希望对大家有所帮助!
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%--建立目录--%>
<%@ page import="java.io.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title> JSP通用范例大全 </title>
</head>
<body>
<center><font size=5>建立目录</font></center>
<br><hr><br>
<%
String path=request.getRealPath("/");
File dirName=new File(path+"dirtest");
if(dirName.exists())
out.println("目录"+path+"dirtest"+"已存在");
else{
dirName.mkdir();
out.println("目录"+path+"dirtest"+"不存在,已完成建立");
}
%>
</body>
</html>
上一篇:
ex9_02.jsp
下一篇:
成本管理背景指导