📄 809907.xml
字号:
<?xml version='1.0' encoding='GB2312'?>
<?xml-stylesheet type='text/xsl' href='../csdn.xsl'?>
<Topic>
<Issue>
<PostUserNickName>惊风雷</PostUserNickName>
<rank>一级(初级)</rank>
<ranknum>user1</ranknum>
<credit>100</credit>
<TopicId>809907</TopicId>
<TopicName>怎样在WebServer的根目录下创建目录(用相对路径)</TopicName>
<PostUserId>132443</PostUserId>
<PostUserName>rocie</PostUserName>
<RoomName>JSP</RoomName>
<ReplyNum>2</ReplyNum>
<PostDateTime>2002-6-17 15:45:19</PostDateTime>
<Point>60</Point>
<ReadNum>0</ReadNum>
<RoomId>28</RoomId>
<EndState>2</EndState>
<Content>pathname=".\\upload";
File file=new File(pathname);
file.mkdir();
后就在C:\Documents and Settings\Administrator\「开始」菜单\程序\Apache Tomcat 4.0里创建了一个目录。
而我想在WebServer的根目录下创建的。
谁能帮我解决这个问题呢,谢谢了。
</Content>
</Issue>
<Replys>
<Reply>
<PostUserNickName>晓彬</PostUserNickName>
<rank>两星(中级)</rank>
<ranknum>star2</ranknum>
<credit>135</credit>
<ReplyID>5263925</ReplyID>
<TopicID>809907</TopicID>
<PostUserId>173450</PostUserId>
<PostUserName>Andrawu</PostUserName>
<Point>60</Point>
<Content>try:
<%
String sPath = request.getRealPath("/") ; //来得到WebServer的根目录的绝对路径
//然后:
String pathname=sPath+"upload";
File file=new File(pathname);
file.mkdir();
%>
</Content>
<PostDateTime>2002-6-17 17:26:43</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>惊风雷</PostUserNickName>
<rank>一级(初级)</rank>
<ranknum>user1</ranknum>
<credit>100</credit>
<ReplyID>5273521</ReplyID>
<TopicID>809907</TopicID>
<PostUserId>132443</PostUserId>
<PostUserName>rocie</PostUserName>
<Point>0</Point>
<Content>thanx!</Content>
<PostDateTime>2002-6-18 10:22:34</PostDateTime>
</Reply>
</Replys>
</Topic>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -