你干脆问JAVA能不能定义变量算了,ASP的FOS算什么,JAVA的IO操作更强大,如果连这都不可以,&^76*^&%^$%$#*^

解决方案 »

  1.   

    ......
    public void bianLi(File f){
    File lf[]=f.listFile();
    int i=0;
    while(i<lf.length){
    if(lf[i].isDirectory()) bianLi(lf[i])
    else
    ....do something with lf[i]
    i++;
    }
    }
      

  2.   

    import java.io.*;public class Application3 {
      boolean packFrame = false;  public Application3() {
        copyDir(new File("c:/temp/"),new File("d:/temp/"));
      }  public void copyDir(File src_path,File dest_path){
        if(!dest_path.exists())
          dest_path.mkdirs();
        File[] files = src_path.listFiles();
        for(int i=0;i<files.length;i++){
          File src=files[i];
          File dest=new File(dest_path.getPath()+File.separator+files[i].getName());
          if(!src.isDirectory())
            copyFile(src,dest);
          else
            copyDir(src,dest);
        }
      }  public void copyFile(File src,File dest){
        try{
          System.out.println(src.getAbsoluteFile()+" -> "+dest.getAbsoluteFile());
          FileInputStream in = new FileInputStream(src);
          FileOutputStream out = new FileOutputStream(dest);
          byte[] buffer = new byte[1024];
          int length = -1;
          while((length=in.read(buffer))!=-1){
                  out.write(buffer,0,length);
          }
          out.flush();
          out.close();
          in.close();
          System.out.println("文件复制成功!");
        }catch(Exception e){
          System.out.println("文件复制失败!");
        }
      }  public static void main(String[] args) {
        new Application3();
      }
    }
      

  3.   

    FT..........java.io.* 是干嘛用的?
      

  4.   

    可以自己用深度或广度进行遍历,我自己用vc设计的但算法是一样的,可以进行森林遍历,要的话请来信,Email:[email protected]
      

  5.   

    楼主被ASP弄蒙了,JAVA可比ASP强多了。
    java.io.* 是JAVA中专门用来处理输入输出的包。
    建议楼主查一下java.io.File的JAVA DOC文档就知道了,楼主想做的东西都可以实现