
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE ht
<%@pagelanguage="java"contentType="text/html;charset=UTF-8"pageEncoding="UTF-8"%><!DO...
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.io.File"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%File f=new File("360Downloads"); %>
<%=f.lastModified() %>
<br>
<%=f.getPath() %>
<br>
<%=f.getAbsolutePath() %>
<br>
</body>
</html>
运行结果为:
0
360Downloads
F:\eclipse\360Downloads
问题补充:我的eclipse 在"F:\eclipse"下建立。请你们指点谢谢! 展开
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.io.File"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%File f=new File("360Downloads"); %>
<%=f.lastModified() %>
<br>
<%=f.getPath() %>
<br>
<%=f.getAbsolutePath() %>
<br>
</body>
</html>
运行结果为:
0
360Downloads
F:\eclipse\360Downloads
问题补充:我的eclipse 在"F:\eclipse"下建立。请你们指点谢谢! 展开
2个回答
展开全部
接上面问题
那是因为getAbsolutePath()是返回绝对路径。
你的项目是不是在F:\eclipse目录下?
那是因为getAbsolutePath()是返回绝对路径。
你的项目是不是在F:\eclipse目录下?
更多追问追答
追问
我的目录是“F:\workspace”?
追答
不应该啊
getAbsolutePath():返回抽象路径名的绝对路径名字符串。
它既然是显示F:\eclipse\360Downloads
就说明你的项目是在F:\eclipse里的
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询