Browse the native directory in the JSP

Source: Internet
Author: User
Js

<%@ page contenttype= "text/html;charset=gb2312"%>
<% @page import= "java.io.*"%>

<%string wxz=request.getparameter ("Path");

if (wxz!=null) {

File Dir=new file (WXZ);
if (Dir.getparent ()!=null) {
Out.println ("<a href=\" file.jsp?) Path= "+dir.getparent () +" \\\ "... </a><br> ");
}
String temp[]=dir.list ();
for (int i=0;i<temp.length;i++) {
File Ft=new file (Temp[i]);

String wxz1=wxz+ft;
File Ppp=new file (WXZ1);
if (Ppp.isdirectory ()) {
Out.println ("<a href=\" file.jsp?) Path= "+wxz1+" \\\ ">" +ft+ "</a><br>");
}else{
Out.println (ft+ "<br>");
}

}
}
%>
<HTML>
<HEAD>
<meta name= "generator" content= Microsoft Visual InterDev 1.0 >
<meta http-equiv= "Content-type" content= "text/html; Charset=gb_2312-80 ">
<TITLE> Welcome </TITLE>
<style type=text/css>.unnamed1 {
Font-size:9pt
}
</STYLE>
</HEAD>
<body background=index.files/bg3.gif bgcolor= #ffffff >

<CENTER>

<form action=file.jsp method=post>
<TABLE>
<TBODY>
<TR>
<td><span class=unnamed1><b> path name </B> </SPAN></TD>
<td><input class=unnamed1 name=path></td></tr>

<div align=center>
<table width=200>
<TBODY>
<TR>
<TD align=middle><input class=unnamed1 type=submit value= Confirmation ></TD>
<td
Align=middle><input class=unnamed1 type=reset value= Cancel ></td></tr></tbody></table ></div></form></span></center><span class=unnamed1>



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.