how to write program(java or c) to download the whole web site
How to write a program to download the whole web pages of a specific web site? Better I can download all the static web pages and dynamic pages(like asp, jsp, servlet generated pages) through my own program.
If you're doing this server-side just use tar + gz or bz2. Client side you're never going to be able to get the dynamic pages unless you know the architecture of the site in so much detail that you must have access to the server.
Really you likely don't need to write a program to do this. wget (and likely curl as well) already have "mirroring" features. I'm sure there are programs written for windows as well.
You will only be able to download html code unless you are ftping or sshing into an account.
If I understand correctly, you want a program that automatically gets all files of a certain site. Try searching for spiders.
A Spider starts intially at a start page and move on to other links on that page. If programmed to do so, it can download the file and images. The spider will recursively visit all pages for the site by restricting to the specific domain.
I need a software (or write my own program) that download sites every 24 hours
What I really want is a software(better I can have the source code) that I can download the web site I want every 24 hours( or the hours I specified). I also wish I can config how many sites I want to download.
robeyh said that "Client side you're never going to be able to get the dynamic pages unless you know the architecture of the site in so much detail that you must have access to the server." Why the software cannot do that at client side? I do wish to download the sites that dynamically generate web pages.
the problem is that with dynamic pages the page that is given to the client is not the actual page. What you need to properly mirror dynamic pages is the code used as well as any information sources used by that code. For static pages wget should work just fine.
this might be the equivalent of duck hunting with an anti aircraft gun but what you want is handled very well by Subversion + webdav + apache. Not only will it allow you to download your entire site but it will keep track of every revision you have made to it.