jimphei學習工作室

          jimphei學習工作室

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            23 隨筆 :: 0 文章 :: 1 評論 :: 0 Trackbacks
              public static void main(String[] args) {
                  
          // TODO 自動生成方法存根
                  File f=new File("e:/jimphei");
                  tree(f,
          0);
              }

              
          public static void tree(File f,int level)
              
          {
                  String strlen
          ="";
                  
          for(int i=0;i<level;i++)
                  
          {
                      strlen
          +="   ";
                  }

                  File[] childs
          =f.listFiles();
                  
          for(int i=0;i<childs.length;i++)
                  
          {
                      System.out.println(strlen
          +childs[i].getName());
                      
          if(childs[i].isDirectory()){
                          tree(childs[i],level
          +1);
                      }

                  }

              }
          posted on 2009-03-23 20:43 jimphei 閱讀(72) 評論(0)  編輯  收藏

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


          網站導航:
           
          主站蜘蛛池模板: 大邑县| 肇源县| 奉新县| 石渠县| 四会市| 湛江市| 赤城县| 德化县| 永靖县| 中江县| 西和县| 达尔| 凌海市| 甘孜县| 察隅县| 马关县| 临城县| 呼和浩特市| 英德市| 宿州市| 垦利县| 兴化市| 崇礼县| 清镇市| 响水县| 东乌| 桃江县| 武宁县| 天峻县| 阳山县| 河北区| 平利县| 崇仁县| 台中县| 内黄县| 静宁县| 浙江省| 汉源县| 芒康县| 阜南县| 寿宁县|