要下载整个网站是很难保证的,因为其实所谓的下载一个网站
现在的方法都是通过首页,然后遍历其中的所有连接,将每个连接对应的页面或者文件
下载了,然后继续递归下载这个页面所对应的连接这样并不能保证所有的文件都已经下载,只能够保证所有的连接都下载了,而且只是那种
明确的使用<a href=>所指向的连接,如果那个网站的那个下载连接只要稍微用了
JavaScript你就非常难以解决了

解决方案 »

  1.   

    我java是选修的,我才学了那么一丁点,有些类写了,都不知道对不对,请各位高手指教mport java.io.*;
    import java.net.*;
    public class DownLoad{
    URL url;
    String objFile;
    long nStartPos;
    RandomAccessFile rf;
    public DownLoad(String objFile,long nStartPos) throws IOException{
    this.nStartPos=nStartPos;
    this.objFile=objFile;
    rf=new RandomAccessFile(objFile,"rw");
    //
    rf.seek(nStartPos);
    }
    public synchronized int write(byte[] b,int nStart,int len){
    int n=-1;
    try{
    rf.write(b,nStart,len);
    n=len;
    }catch(IOException ioe){
    ioe.printStackTrace();
    }
    return n;
    }
    public void close()throws IOException{
    rf.close();
    }
    }多多指教:)
    最好你们也写出一个类来,并说明、解释一下