隨筆 - 64  文章 - 9  trackbacks - 0
          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(6)

          我參與的團隊

          隨筆分類(88)

          隨筆檔案(92)

          文章分類(142)

          文章檔案(182)

          天基成員

          學習園

          我的海角

          搜索

          •  

          積分與排名

          • 積分 - 183507
          • 排名 - 319

          最新評論

          package user.file;
          import java.io.*;
          public class FileDir{
          String newname,oldname;
          StringBuffer allFiles;
          public FileDir{
            allFiles=new StringBuffer();
          }
          public void setnewname(String s){
          newname=s;
          if(newname!=null)
          {File dir=new File("D:\\apache-tomcat-5.5.26\\webapps",newname);
          dir.mkdir();
              }
          }
          public String getnewname(){
          return newname;
          }
          public void setoldname(String s){
          oldname=s;
          }
          public String getoldname(){
          return oldname;
          }
          public StringBuffer getAllFiles(){
          if(oldname!=null){
          {File dir=new File("D:\\apache-tomcat-5.5.26\\webapps",oldname);
          File a[]=dir.listFiles();
          for(int k=0;k<a.length;k++){
          if(a[k].isDirectory()){
          allFiles.append("<br>子目錄:",+a[k].getName());
                                }
          for(int k=0;k<a.length;k++){
          if(a[k].isFile()){
          allFiles.append("<br>文件:",+a[k].getName());
                         }
                  }
          return allFiles;
            }
          }

           

          <%@ page contentType="text/html;Charset=gbk"%>
          <%@ pageimport="user.file.FileDir"%>
          <html>
          <body bgcolor=blue><font size=20>
          <jsp:useBean id="dir"  class="user.file.FieDir" scope="page"/>
          <jsp:setProperty name="dir" property="newWebDirName" param="newWebDirName"/>
          <jsp:setProperty name="dir" property="oldWebDirName" param="oldWebDirName"/>
          <form action="" Method="post">
          輸入新的web服務目錄的名字:<input type=text name="newWebDirName" value="dalian">
          <br>輸入已有web服務目錄的名字:<input type=text name="oldWebDirName" value="ch4">
          <input  type=submit value="提交"
          </form>
          新建的服務目:<jsp:getProperty name="dir" property="newWebDirName" />
          <br>已有的服務目錄:<jsp:getProperty name="dir" property="oldWebDirName" />
          子目錄和文件:
          <jsp:getProperty name="dir"  property="allFiles"/>
          </font></body></html>

          posted on 2009-03-24 11:47 鵬凌 閱讀(185) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 邓州市| 福建省| 诸暨市| 肃北| 台北县| 富宁县| 永济市| 定远县| 上杭县| 曲靖市| 白朗县| 同心县| 曲阳县| 湟中县| 滦南县| 乌恰县| 白朗县| 中牟县| 明水县| 且末县| 江津市| 株洲市| 溧阳市| 古浪县| 商城县| 福建省| 成安县| 镇平县| 五家渠市| 罗山县| 清苑县| 改则县| 廊坊市| 万安县| 丹凤县| 张掖市| 叶城县| 平罗县| 高尔夫| 湟源县| 黄大仙区|