HttpURLConnection hrl new HttpURLConnection(new URL("url_of_asp"));
InputStream is = new BufferedInputStream(hrl.getInputStream());
然后你将这个is保存到一个文件就可以了
int read = is.read();
OutputStream os = new BufferedOutputStream(new FileOutputStream("file"));
while(read >= 0) {
os.write(read);
read = is.read();
}
InputStream is = new BufferedInputStream(hrl.getInputStream());
然后你将这个is保存到一个文件就可以了
int read = is.read();
OutputStream os = new BufferedOutputStream(new FileOutputStream("file"));
while(read >= 0) {
os.write(read);
read = is.read();
}
再根据得到的InputStream
用IO包写到HTML文件里就行了。
那扩展名可以自己随便写成 .html 吗?
现在有这样一个问题,我读一个 url ,也许是个 。zip 也许是个 html ,或 .asp 我不想把 .zip 读出来后也自己写成 .html ,也不想把 .asp 本来都成 html 了,又写成了.asp
那我该怎么办?不知道我说明白了没有